Workspace Already in Transaction mode

179
2
Jump to solution
04-02-2024 06:25 AM
BrandonMcAlister
Occasional Contributor

So I have a python script that is currently written in ArcGIS Notebooks. It will eventually be saved as a tool in the toolbox for users to complete a series of Quarterly tasks. my specific error is new and hasn't happened when I previously wrote this code last week but over the weekend the gremlins came in and gremlined. 


This specific block of code has a search cursor then saves it as an array, then turns into a while loop which creates a dictionary key from the search cursor and then accesses coordinates saved in a dictionary created earlier in the script. 

Sometimes the key that is created does not exist so an if statement checks for a Boolean value and moves onto the next step which takes the coordinates from the dictionary and turns them into float values to be used to update the coordinates of the selected feature.

I have two update cursors separate from each other, the first updates coordinates, and the second updates the progress checker field. (Incase the tool fails or crashes it can pick up where it left off)

When the first cursor runs I get the Runtime Error: Workspace Already in Transaction mode. I have tried this help doc but nothing worked. https://support.esri.com/en-us/knowledge-base/error-workspace-already-in-transaction-mode-000019111 

Is it because I have two update cursors? When I remove the second cursor the error still persists. (Would I need to remove the second then restart the program?). Here is the troublesome code block:

NJDEPBrandonMcAlister_0-1712064101350.png

Ignore the else statement I haven't written the code for it since it will be the same and the original If statement.

Also the help doc says to use the arcpy.da.Editor.startEditing(False, False) but it returns a TypeError: descriptor 'startEditing' for 'Workspace Editor' objects doesn't apply to a 'bool' object.

Thanks,
Brandon
0 Kudos
1 Solution

Accepted Solutions
BlakeTerhune
MVP Regular Contributor

To start, you need to pass a workspace argument to start editing.

edit = arcpy.da.Editor(workspace)

Fix that and then see where you're at.

View solution in original post

0 Kudos
2 Replies
BlakeTerhune
MVP Regular Contributor

To start, you need to pass a workspace argument to start editing.

edit = arcpy.da.Editor(workspace)

Fix that and then see where you're at.

0 Kudos
BrandonMcAlister
Occasional Contributor

@BlakeTerhune 

That appears to have worked, I could've sworn I tried that yesterday

Thanks,
Brandon
0 Kudos