ApplyEdits followed by arcpy.da.UpdateCursor

2058
1
12-12-2012 10:58 AM
MortenHansen
New Contributor II
I have a geoprocessing tool (python script) published to an ArcGIS server 10.1. It updates some features in a feature class.

The tool works fine, except from if I run the tool after I have edited data in the same feature class using the javascript editor widget (and the standard applyEdits method of the feature service).

I am using a versioned feature class with archiving enabled.

The problem occurs when the python script tries to update data (in the same feature class):
with arcpy.da.Editor(wp) as edit:
  with arcpy.da.UpdateCursor(wp,.... ) as updateCursor:
      ....
      updateCursor.updateRow(row)


If I restart the feature service and my geoprocessing service in the ArcGIS Server Manager, I can run the tool successfully again.

I am using the SDE.DEFAULT version.

Hope you help me fix the problem? (or explain the reason)
Tags (2)
0 Kudos
1 Reply
MortenHansen
New Contributor II
Do I need to close the edit session explicitly after "applyEdits" when working with versioned data?
And how can I do so (through javascript)?
0 Kudos