> I still don't see why we need to get the ids _after_, can anybody > enlighten me?
We do not need to; only if they are assigned after we have a chance to correct them (as in the WFSDataStore case). If they are assigned a good value from the get go we should be able to use a good value. In the workflow of JDBCInsertFeatureWriter; it appears as if the value is only assigned during the write() method; but it is hard to know. If this is the case the client code will not be told about the new value (ie post writer.write() ) until the batch feature event goes out; and then only if they bothered to hold on to the FeatureIdentifier (in the uDig case this occurs if a user has selected a feature they just added). > From what I know, both in the case of sequences and > serial keys the value is generated right away when you insert, > and if the transaction fails, the value is simply lost. That makes sense; and explains why the value is not available until after write() is called - we should also check the API and ensure that write() cannot be called multiple times. >> And because of this, key generation between multiple transactions will >> probably uncover some bugs. > > As long as reliable ways to generate a key are used (sequences, serials, > UUID) this won't happen (I mean, it won't happen due to getting keys > before the connection is committed, other causes might cause a bug > to trigger). Thanks for the background Andrea; the only change I will need to do is supply a value for the FeatureId to wrap around prior to write being called; and then we can fill in the correct value after the write method). So this leaves us with only one problem left: how to prevent multiple commits on a transaction (if I am reading the code correctly that is what it is doing). Jody ------------------------------------------------------------------------------ The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com _______________________________________________ Geotools-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-devel
