laptop and a wrench

Bug

Data Access module's update cursor updates 1000 records then fails with "RuntimeError: The requested operation is invalid on a closed state" when the data is in a versioned SDE.

Last Published: August 25, 2014 ArcGIS for Desktop
Bug ID Number NIM084298
SubmittedAugust 30, 2012
Last ModifiedJune 5, 2024
Applies toArcGIS for Desktop
Version found10.1
Operating SystemWindows OS
Operating System VersionXP
Version Fixed10.1
StatusFixed

Workaround

Add a startOperation() and stopOperation() method into the edit session from within the python code. For example: #####import arcpyDBODefault = r"Database Connections\test.sde"Seg = "test.DBO.TestLimits"count = 1print "About to start editing"edit = arcpy.da.Editor(DBODefault)message = "Started Editing database..."edit.startEditing(False, True)edit.startOperation()with da.UpdateCursor(Seg,("Bfield")) as cur: for row in cur: row[0] = "Updated_fake" cur.updateRow(row) message = "Updated "+ str(count) print message count = count +1edit.stopOperation()edit.stopEditing(True)

Steps to Reproduce

Bug ID: NIM084298

Software:

  • ArcGIS for Desktop

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options