You are correct - the whole adding Features and assigning Fids workflow is messed up. See GeoAPI for a more realistic workflow that we have not had time to implement. Basically we should not return the "Set" until *commit* is called (since some added features may be removed by later operations in the transaction).
When I last looked poor GeoServer was adding Features one at a time in order to verify that it was successful - hense the ability to report things in order :-( I may be getting confused with the update process however. We could change this to be a SortedSet - with the order being determined by insertion order. Or simply a unmodifiable List. Basically we ran out of enthusiasm on this issue (everyone was stick of talking about it on email). Jody > Hi, > looking at the transaction code in Geoserver I found a > comment that prompted me to look at the WFS specification > about how inserted feature fids are returned. > The specification states: > > The <InsertResult> element contains one or more feature identifiers of > newly created feature instances. One <InsertResult> element is reported > per <Insert> element in the request. The insert results are reported in > the order in which the <Insert> operations were contained in the > <Transaction> element. Additionally, they can be correlated using the > handle attribute if it was specified. > > Now, Geoserver uses FeatureStore.addFeatures(xxx) to add features > into the datastore, which returns a Set. The Set is usually > implementd using an HashSet, which is not insertion order preserving, > meaning that in the end we're not satisfying the WFS spec > (I guess no cite test makes sure proper fid insertion order is satisfied). > > Uarg, this seems to me like a major issue. We can solve it easily > in Geoserver by switching back to the FeatureWriter API (getting > an append feature writer), but it suprise me a little since the > DataStore API was inspired by WFS no? > > Cheers > Andrea > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Geoserver-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/geoserver-devel > ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Geotools-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-devel
