Select to view content in your preferred language

workspace in editor object in ArcGIS Pro 2.9

344
2
07-30-2022 03:40 PM
YinghongLi1
Occasional Contributor

I have a script to insert rows into the table which is versioned. I added the table to my map project and changed it to my version.  However, the SDE connection file is set to the default version and I used this connection file as the workspace for the editor object's startEdition method. When I ran my script,  I got this error message:  workspace already in transaction mode.   Then I switched my connection to my edit version so the table in my map project and connection file all point to the same version.  My script worked.  The new rows were inserted successfully. 

My question is:  is there a way that I can set up the workspace to point to my editing version in the code?  My users change versions during the daily work and it is really a problem if they have to create a lot of connection files that point to different versions.  I have searched and I did not find any useful info.

Thanks

0 Kudos
2 Replies
by Anonymous User
Not applicable

Take a look at this arcpy method:

ChangeVersion 

 

YinghongLi1
Occasional Contributor

I may miss something.  The change version geoprocessing tool only changes the version of a layer or table.  It is not for a workspace.

Thanks

 

0 Kudos