Commits

John Paulett committed 18a6777

Added a SQL transaction around the update SQL to prevent partial updates of the database.

Comments (0)

Files changed (1)

src/main/java/org/nrg/xdat/XDAT.java

 	    
 	    sb.append("-- If you are running from pgAdmin, remove the following line to stop on errors (pgAdmin does not recognize the statement)");
 	    sb.append("\n\\set ON_ERROR_STOP 1;");
+	    sb.append("BEGIN;\n");
 	    
 	    Iterator iter = SQLUpdateGenerator.GetSQLCreate().iterator();
 	    while (iter.hasNext())
 	    {
 	        sb.append(iter.next() +"\n--BR\n");
 	    }
+	    sb.append("COMMIT;\n");
 		FileUtils.OutputToFile(sb.toString(),file);
 		
 		logger.info("File Created: " + file);