Hi all,
I could not find a way to use my own python script on a branch while editing in Pro on this same branch because of locking issues (branch versioned data). Python can not re-use the branch connection from ArcGIS Pro and wants to create a new connection, but it can not, because the branch is already locked by ArcGIS Pro.
It is recommended in documentation to let a python script work directly on the service using Arcgis API on a separate branch, but this is not an option for us, as we would like to use Python tools to help editors fill in specific attributes while working in an edit session in Pro.
I tried different strategies.
I see no option to stop editing session in Pro and turn back to read only connection with the branch? I have tried to change the version to default, let the pythonscript run and change back again, but if an edit session already was opened in Pro, because of caching, locking still happens. Even if the edits are already saved. Also changing versions from python takes like for ever, because it can only do this by layer or table and our service is huge. Script took about 14 minutes and then crashed because locking still existed.
I tried editing with python locally with arcpy (not connecting directly to de service with arcgis api but using ArcPy), but changes are then not saved in the service and get overwritten as soon as you start editing in Pro, because a new cache gets built up from the service as soon as you start editing.
The only way I could get the python tool working, was bij restarting ArcGIS Pro, opening a new project and run the script...
The only option I now see is building a kind of C## wrapper around my python toolbox? Because C## has more options for handling branches and caches?
Can anyone confirm my findings or give me an other solution?
Any further insight will be appreciated!
Thanks!