SDE Stuck in Transaction Mode

5303
7
09-26-2014 02:21 PM
BrynneFarrell1
New Contributor II

My script is using arcpy's Editor and an InsertCursor to insert data. However, whenever the "insertRow" function of the cursor is called, an exception is thrown with the message "workspace already in transaction mode."

 

The script is connecting to an SDE database. The version of ArcMap installed is 10.2. An excerpt of the script is below.

 

Even after rebooting the computer running the script, this issue persists. Are there any suggestions? I've had no luck finding suggestions on what to do to better understand this error.

 

editor = da.Editor(wkspc) editor.startEditing(True, True) editor.startOperation() insert = da.InsertCursor(target_fc, target_list) insert.insertRow(row) editor.stopOperation() editor.stopEditing(True)
Tags (4)
0 Kudos
7 Replies
JakeSkinner
Esri Esteemed Contributor

Hi Brian,

If your table/feature class is not registered as versioned, try setting the multiuser_mode to False.  Ex:

editor.startEditing(True, False)

Emilbrundage
New Contributor III

I am having the same issue (arcgis desktop - Error with da.UpdateCursor and SDE feature classes - Geographic Information Systems...). Was this ever resolved on your end? I am using 10.1 in an oracle database.

0 Kudos
BrynneFarrell1
New Contributor II

I have, unfortunately, not found a satisfactory result. I wound up changing the script back to editing a Geodatabase. We're supposed to get a new SDE database setup soon and I'm hoping to have better luck with that attempt.

0 Kudos
BenNadler
Esri Contributor

Working with Emil brundage I was able to get his script running by making sure the editor workspace is defined by a connection file that was pointing to the correct edit version,   initialized the editor with (false, true) parameters, and removing the start and stop edit operation. I am not sure the last step was required (it is certainly not best practices as defined in the help docs) but it got things working.

Emilbrundage
New Contributor III

I just made this change on my end and the results were the same as before.

0 Kudos
BenNadler
Esri Contributor

Changing the edit mode of the editor initialization to shared ...(false, true)  fixed that issue. God luck with the rest!

Emilbrundage
New Contributor III