While updating the field using update cursor. Getting the error:The requested operation is invalid on a closed state. Here is my code:
editor = arcpy.da.Editor(workspace)
editor.startEditing(False, True)
editor.startOperation()
cursor = arcpy.da.UpdateCursor(<>feature_class,[<fields>])
for row in cursor:
# updation stuff comes here
cursor.updateRow(row)
del row
del cursor
editor.stopOperation()
editor.stopEditing(True)
del editor
I appreciate any help or suggestions.
Even though same error it is throwing.
In this practically duplicate post The requested operation is invalid on a closed state you included the creation of the sde connection. Please create it manually using the same configuration and validate manually that you are able to edit the data (Standard or Advanced license required).
Manually I'm able to edit the data. While using arcpy I'm facing error.
Is the data set you are trying to update versioned or not? Also, it is helpful to provide the actual error message and stack trace along with it.