Multi User Editing

2851
9
01-05-2016 11:50 PM
Anilgoud
New Contributor

I have written code for multi user editing for our project. However, two users cannot edit the features at same time. Please help

0 Kudos
9 Replies
VinceAngelo
Esri Esteemed Contributor

What is the data source for this editing application?  You should be sure to use multiuser sources (databases) for multiuser applications.

- V

0 Kudos
DerekLaw
Esri Community Moderator

Hi Anilo,

Just to add onto Vince's post, if you are using ArcGIS for Desktop to edit your data, and your source data is stored in an enterprise geodatabase, then you can leverage the versioned editing functionality.

An overview of versioning—ArcGIS Help | ArcGIS for Desktop

Hope this helps,

0 Kudos
Anilgoud
New Contributor

Thanks Vince and Derek,

Thanks for your replies..

I am using Enterprise SDE, and using SDE.QAQC version Datasource. Issue is, users can edit the data from any locations if there is no edit conflicts. However, when multiple users try creating features at same time, SDE allows only one user to save edits, and the others are thrown exceptions like ..

1. "Objects in this class cannot be updated outside an edit session"

2. "The version has been redefined to reference a new database state. "

3. "Exception from HRESULT:0x80041055"

4. "The Work Space cannot being edited. [SDE.QAQC]"

etc.,

Now, I don't understand where the issue is? I have used

IMultiuserWorkspaceEdit muConsumerWorkspaceEdit = (IMultiuserWorkspaceEdit)pConFtrCls.FeatureDataset.Workspace;

   IWorkspace pConWrkspce = pConFtrCls.FeatureDataset.Workspace;

            IWorkspaceEdit pConWorkspaceEdit = pConWrkspce as IWorkspaceEdit;

         

....

if (!muConsumerWorkspaceEdit.SupportsMultiuserEditSessionMode(esriMultiuserEditSessionMode.esriMESMVersioned))

                {

                    throw new ArgumentException("The workspace does not support versioned editing.");

                }

                muConsumerWorkspaceEdit.StartMultiuserEditing(esriMultiuserEditSessionMode.esriMESMVersioned);

              

   if (pConWorkspaceEdit.IsBeingEdited()) { pConWorkspaceEdit.StopEditing(true); }

                pConWorkspaceEdit.StartEditing(false);

            

                pConWorkspaceEdit.StartEditOperation();

                ESRI.ArcGIS.Geodatabase.IFeature pConsumerFtr = pConFtrCls.CreateFeature();

//Then I am filling the shape and all other attributes..

//Then storing the feature

  pConsumerFtr.Store();

                pConWorkspaceEdit.StopEditOperation();

/////////////////

Please help.. I am not understanding where I went wrong. Seems everything fine. Still, multiuser editing is not happening.

0 Kudos
RebeccaStrauch__GISP
MVP Esteemed Contributor

Have you tried creating a version for each user below the QAQC.  That way they are editing in a different "space" of version thread (can't think of the correct term right now).  Each user will want to reconcile to pull any updates from QAQC at the start of the edit session (at least).  When they post to QAQC, if there are conflicts, they can be reviewed at that time.

That is how we typically do this in any case.

0 Kudos
Anilgoud
New Contributor

Thank you for your reply Rebecca,

That sounds great! I will definitely give a try. But, do I have to create new version each time?

0 Kudos
RebeccaStrauch__GISP
MVP Esteemed Contributor

You can use each of the versions as often as you want/need, but I would make sure that you reconcile and post  (r&p) whenever possible (and practical).

From experience, we had a version off of our QAQC that wasn't going to go into effect for 6months (delayed). We had another "active" version off of QAQC that had daily edits and regular r&p to QAQC but we were not reconciling these to the delayed post version.  Even though we never worked on the same feature, when we were finally ready to roll it up, the reconcile pulled in all the changes the active version had been making.....took a while to verify them all again.

Also, you will want to make sure to "compress" your master once in a while.  Occasionally I like to make sure everything has been rolled up to the master, delete my versions...compress etc...then recreate the versions.  This will clean up the "add/delete" tables and can speed up editing if many changes are being made.l.plus, I like to get back to stats-zero once in a while.

i have SQL scripts (run in SQL manager) that I run so I can monitor how many records are in the A & D tables so I know when I want to run thru the compress project.  I ink you can compress even without doing the steps above, but I just like to keep things clean.

0 Kudos
Anilgoud
New Contributor

Thanks Rebecca, will give a try and get back to you!!

0 Kudos
DerekLaw
Esri Community Moderator

Hi Anil,

I am not a developer and can't help with your custom code. I suggest you post your question (with the custom code) in these discussion threads:

ArcObjects SDK and Geodatabase

Good luck,

0 Kudos
Anilgoud
New Contributor

No issues Derek, thanks for your help!!

0 Kudos