From: Aaron J. <yo...@ml...> - 2006-03-21 23:48:16
|
Ok, I've looked through the test code now and am still having trouble. When it gets to the commit line I get the following IOException: java.io.IOException: An error occured at org.geotools.data.wfs.WFSTransactionState.commit(WFSTransactionState.java:135) at org.geotools.data.DefaultTransaction.commit(DefaultTransaction.java:176) Also, when I'm trying to add a city to the topp:tasmania_cities feature, is this the proper way to go about doing it? -- FeatureStore fs = (FeatureStore)ds.getFeatureSource(ft.getTypeName()); fs.setTransaction(t); FeatureCollection fc = fs.getFeatures(); fc.add(new Object []{someMultipoint, "valuea", "valueb", "valuec", "valued"}); -- Yolan ************************************************* * Yolan (Aaron Jackson) yo...@ml... * * http://mlug.missouri.edu/~yolan/ * * AIM: YolanLINUX, YolanOTHER, YolanLAPTOP * * ICQ: 74624109 * ************************************************* * Doubling Technologies * ************************** On Tue, 21 Mar 2006, David Zwiers wrote: > Aaron, > > You will need to create a real transaction as AutoCommit is not supported by > the WFS datastore. > > If you look at the test code for writing( > http://svn.geotools.org/geotools/trunk/gt/plugin/wfs/test/org/geotools/data/wfs/WFSDataStoreWriteOnlineTest.java) > you will see the pertinent lines (inc. below). > > HTH, > > David > > FeatureType ft = ... > WFSDataStore ds = ... > > Transaction t = new DefaultTransaction(); > FeatureStore fs = (FeatureStore)ds.getFeatureSource(ft.getTypeName()); > fs.setTransaction(t); > > // do your edits using fs > > t.commit(); > > > On 3/20/06, Aaron Jackson <yo...@ml...> wrote: >> >> I've been attempting to add cities to the topp:tasmania_cities demo for a >> couple days now and have been getting the following error: >> Exception in thread "AWT-EventQueue-0" >> java.lang.UnsupportedOperationException: Schema creation not supported >> at org.geotools.data.AbstractDataStore.getFeatureWriter( >> AbstractDataStore.java:191) >> at org.geotools.data.AbstractDataStore.getFeatureWriter( >> AbstractDataStore.java:510) >> >> I think it is a problem with my transaction type. In the advanced data >> access tutorials they use Transaction.AUTO_COMMIT. The exception occurs on >> the line where I get the feature writer from the WFS DataStore. >> FeatureWriter fw = wfs.getFeatureWriter(feature, Transaction.AUTO_COMMIT); >> >> Should I be using a different value for Transaction? Any suggestions >> would be helpful. >> >> Also, in the tutorial they use the Feature f.setAttributes() method and it >> no longer seems to exist. Should I use f.setAttribute("name", Object) for >> each attribute instead? >> >> Yolan >> >> ************************************************* >> * Yolan (Aaron Jackson) yo...@ml... * >> * http://mlug.missouri.edu/~yolan/ * >> * AIM: YolanLINUX, YolanOTHER, YolanLAPTOP * >> * ICQ: 74624109 * >> ************************************************* >> * Doubling Technologies * >> ************************** >> >> >> ------------------------------------------------------- >> This SF.Net email is sponsored by xPML, a groundbreaking scripting >> language >> that extends applications into web and mobile media. Attend the live >> webcast >> and join the prime developer group breaking into this new coding >> territory! >> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 >> _______________________________________________ >> Geotools-gt2-users mailing list >> Geo...@li... >> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users >> > |