[fdo-users] RE: .net Wrapper quirks
Jackie Ng
jumpinjackie at gmail.com
Sat Jul 24 08:36:19 EDT 2010
Try this:
Instead of clearing and adding everytime you read a feature, load the
IInsert's property values with the right DataValue/GeometryValue objects
using the Class Definition *once*.
Then in your loop, instead of clearing the collection and adding fresh
instances, go through the existing DataValue/GeometryValue setting them to
null (using SetNull()) first and then update these values with the ones from
your reader.
For extra stability, you could cache these DataValue/GeometryValue objects
in a dictionary (using the property name as the key) and everytime you need
to SetNull() and update the values use the dictionary instead of the
PropertyValueCollection. The insert will still work because the
PropertyValueCollection is holding the same DataValue/GeometryValue
references as the ones in your dictionary.
This is how I do it in FDO Toolbox, and it has been very stable thus far.
http://code.google.com/p/fdotoolbox/source/browse/trunk/FdoToolbox.Core/ETL/Operations/FdoOutputOperation.cs
- Jackie
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/net-Wrapper-quirks-tp2049912p5332651.html
Sent from the FDO Users mailing list archive at Nabble.com.
More information about the fdo-users
mailing list