ArcGIS Pro 2.1 causes crash on da.InsertCursor

326
1
01-22-2018 07:16 PM
RogerLoweth
New Contributor

Hi all:

I've just updated to ArcGIS Pro 2.1.0 and get the following error on code that has been working perfectly well in ArcGIS Pro 2.0.1 for months:

cursor = arcpy.da.InsertCursor(inputvesselfile, ['SHAPE@X', 'SHAPE@Y','SHAPE@Z', 'SHAPE@M'] + headers) 
                    count = 0
                    for row in reader:
                        newrow = [float(row[0]), float(row[1]), float(row[2]), int(row[5])] + row
                        line_name = row[6]
                        cursor.insertRow(newrow) 
                        count += 1
                        if count%100 == 0:
                            arcpy.SetProgressorPosition(count)
                    del cursor
‍‍‍‍‍‍‍‍‍‍

 The error I get is:

Traceback (most recent call last):
File "D:\roger\Documents\2_scripts_SS\p190_ss.py", line 1201, in <module>
main()
File "D:\roger\Documents\2_scripts_SS\p190_ss.py", line 1196, in main
showGpMessage(logFile)
File "D:\roger\Documents\2_scripts_SS\p190_ss.py", line 1016, in main
showGpMessage(logFile)
File "D:\roger\Documents\2_scripts_SS\p190_ss.py", line 1009, in main
cursor.insertRow(newrow)
RuntimeError: workspace already in transaction mode

The error is happening on the second iteration of the code block, at cursor.insertRow(newrow).

Can anyone see why it's happening?

If not, can anyone tell me how to roll back to v2.0.1 which was working just fine?

Thanks, Roger

0 Kudos
1 Reply
RogerLoweth
New Contributor

I've tried looking at the value of 'cursor' on each iteration of the block, and the memory location is exactly the same as in the previous iteration, even though the file 'inputvesselfile' has been deleted and the variable reassigned to a new physical file in between each iteration.  Is that to be expected??

0 Kudos