Home arrow GIS Data & Resources arrow Scripts and Code arrow C# Code arrow ArcGIS Server - Pseudo Concurrent editing strategy
ArcGIS Server - Pseudo Concurrent editing strategy PDF Print E-mail

Written by Steve Gourley,

When building geospatial editing web applications one needs to plan, or don't, for the fact that two people may edit SDE data at the same time. If you aren't and your application isn't used frequently then it is probably not an issue, yet. But you may start to see this error and not know what to do.

The version has been redefined to reference a new database state. [sde.DEFAULT] What happens is more than one edit session starts and one finishes before the rest. This redefines the SDE states table which causes the subsequent save edit operations to fail.  

Our strategy was to put the editing operation in a do while loop. Basically, do the edit operation while SDE did not kick out a version mismatch error. In the code we check if the version has been redefined, if it has refresh it and try again.

A possible better approach would be to create a unique version per edit operation and reconcile that version or lock the thread that has started the edit operation and queue subsequent requests until the lock has been removed.

What are your strategies for overcoming database concurrency?

 

ESRI.ArcGIS.Geodatabase.IVersionedWorkspace3 versionWorkspace = workspace as ESRI.ArcGIS.Geodatabase.IVersionedWorkspace3;

IVersion2 version = versionWorkspace.DefaultVersion as IVersion2;

workspaceEdit = workspace as ESRI.ArcGIS.Geodatabase.IWorkspaceEdit;

 

if (version.IsRedefined)

{

    if (workspaceEdit.IsBeingEdited())

    {

        workspaceEdit.StopEditing(false);

    }

 

    version.RefreshVersion();

}


Users' Comments  
 

No comment posted

Add your comment

23, Sep. 2009
Last Updated ( 23, Sep. 2009 )
 
Next >

AGRC Contacts | UGIC Contacts

feed image feed image

Utah GIS Portal © 2009 AGRC

Optimized for