From: David B. <db...@op...> - 2006-04-06 19:34:13
|
Okay, this still doesnt work. I stepped through the code and the connection to postgresql is still in auto-commit mode which would explain why its not working. private void process() throws Exception { DefaultTransaction trans = new DefaultTransaction(); FeatureWriter aWriter = ds.getFeatureWriter(table_name,trans); while (aWriter.hasNext()) { Feature f = aWriter.next(); // get a feature Geometry g = (Geometry) f.getAttribute(source_column); Geometry g_gen = generalize(g,tolerance); f.setAttribute(dest_colum,g_gen); // modify it aWriter.write(); // write it to DB } aWriter.close(); trans.commit(); } I think the connection first gets setup as a reader and gets defaulted to autocommit and then no one bothers to change it for the transaction the update system is using. dave |