Select to view content in your preferred language

Edit operation failed. Message: Cannot acquire a lock.

104
3
yesterday
AmyRoustCoL
Emerging Contributor

I've taken the instructor-led classes on Utility Networks and done tons of tutorials, but I still find it difficult to troubleshoot errors. Has anyone ever seen this error? I realize the image is really small. The red box says, "Edit operation failed. Message: Cannot acquire a lock."

AmyRoustCoL_0-1779826613896.png

The user is editing on a version and just randomly gets this error from time to time. Our previous editing service was so buggy that I published a brand new one. This error pops up on the new one. 

We have a ticket in with Esri support because his versions won't reconcile with DEFAULT. I don't have that problem, so it's even stranger that one user would have the issue and I don't. Granted, I am an admin and he isn't, but there's just so little to go on that I'm grasping at straws.

0 Kudos
3 Replies
RobertKrisher
Esri Regular Contributor

When this happens you should look at the locks in the database and see who else has a lock on that version. Read the Manage geodatabase locks topic in the online help to learn more.

0 Kudos
HusseinNasser2
Esri Regular Contributor

This particular error (cannot acquire a lock) occurs when you try to edit a version while another user is reading the same version (often from Pro). Which we did not allow prior to 12.1. 

Starting with 12.1, multiple users will be open and view the same version but only one can edit it.

 

Jargon mode activated: When Pro is switching to a version it calls startReading on the version to acquire a read lock. When another user switches to the same version they also call startReading to acquire another read lock on the same version, multiple read locks were always allowed. When the first user attempts to edit Pro calls startEditing to promote its read lock to write lock which is now allowed in 12.1 where it used to fail before because of an existing read lock.

 

Prior to 12.1 only single writer no readers are allowed, with 12.1 single writer, multiple readers allowed.

 

What to do? ask the admin to call purgeLock on the rest end point to purge all readers on that version, beware that this will toss any unsaved edits.

 

PierreloupDucroix
MVP Regular Contributor

Hello,

You indicated that the first edit attempt would trigger the `startEditing` call, but when is `stopEditing` called once the user has finished editing?

I'm trying to find out if it would be possible (in version 12.1 or earlier) for multiple users to take turns editing the same version in ArcGIS Pro or the Web Editor.

Another use case would be parallel editing by a user in Pro and by a toolbox, also in Pro. Currently, it seems that using a toolbox to edit a version cannot benefit from the lock of the logged-in user.

CEO of MAGIS
0 Kudos