Select to view content in your preferred language

Getting Object has no Schema locks Error while trying to create new feature, after Subnetwork Update through REST API GP Service

3173
13
08-12-2022 03:00 AM
MohammedHilal_K
Occasional Contributor

Hi,

I was trying to create an Add-Inn to update the subnetworks through REST API GP Service, because it is very fast compare to the inbuild tool in ArcGIS Pro. For testing purpose I used REST API GP Service directly, the process got success in my branch version. But after the update When I Try to create a feature in current branch version, am getting 'Object has no schema locks' Error. Sometimes I could solve that by switching the branch versions, but sometimes not. 

Any suggestions should be appreciated. 

13 Replies
Dwarburg
Occasional Contributor

Yes, in the Python API this is resolved by .start_reading and .stop_reading which lcoks and unlocks the version for your script to read from it. I posted a description here on stack exchange. arcpy - Extracting data shown in Version Changes on Branch-Versioned feature service before reconcil...

Version.start_reading()
Differences = Version.differences(result_type='objectIds', moment=None) 
Version.stop_reading()

 

0 Kudos
LanceKirby2
Frequent Contributor

I’m curious if you have had a use case where you need to do some edits to a version while the user has it in a project or actively using it somewhere.

 

I am currently needing to update some values in a versioned layer once a user finishes their edit. Right now I’m using just a normal update cursor with not many issues but it’s slow. Was testing with just using the .edit method on a version object through the API and I have to remove their lock in order to establish my own and update the data. After this they still need to reconcile and post, but are getting errors related to no schema locks. I am using .start_editing() and .stop_editing() which I thought would allow their lock to be reestablished, but doesn’t look like that is the case. 

0 Kudos
MohammedHilal_K
Occasional Contributor

I resolved this issue by using SDK. REST end point is not able to resolved my issue. 

0 Kudos
LanceKirby2
Frequent Contributor

Thanks. I figured it out for the python api, basically I just needed to call StartReading() and StopReading() methods on the version object.