Select to view content in your preferred language

Editing Layer with ArcObjects 10 C#

3810
1
05-26-2011 11:49 AM
brianrathburn
Emerging Contributor
Hello,

I am working with a Layer stored in SQL Server via SDE and looking for some advice on how to handle the edit sessions. Currently i have users who are going to be writing between 10-500 points to the layer at a time. At first I had the code setup to use the edit session like below
pWorkspaceEdit.StartEditing(false);
pWorkspaceEdit.StartEditOperation();
//code for adding the point to the layer
pWorkspaceEdit.StopEditOperation();
pWorkspaceEdit.StopEditing(true);
This was causing an error "version has been redefined to reference a new database state"(i think that was the text from the error), this would happen when more than one user would attempt to edit the layer at the same time.

So i removed the start/stop EditOperation lines and that solved the version redifined error, but now every once in a while i will get another error "Underlying DBMS error [dbo.DEFAULT]" when writing to the layer. It doesnt seem to be a data error because I can use the same dataset and sometimes i will get the error and sometimes I wont.


Also on a side note if anyone knows of a better way to write bulk points to a layer I am open to suggestions.

Thanks
Brian
0 Kudos
1 Reply
AlexanderGray
Honored Contributor
If you have multiple users writing the database at the same time I would take a look at what the versioning workflow has to offer.  Unless your transactions are very short and there are no risks of collisions (like you seem to get), versioning is an attractive model.  The following links talks about this.

http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/d/00010000010s000000.ht...

http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/d/0001000000qt000000.ht...
0 Kudos