<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic ApplyEdits followed by arcpy.da.UpdateCursor in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/applyedits-followed-by-arcpy-da-updatecursor/m-p/224319#M8707</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a geoprocessing tool (python script) published to an ArcGIS server 10.1. It updates some features in a feature class. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using a versioned feature class with archiving enabled.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem occurs when the python script tries to update data (in the same feature class):&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
with arcpy.da.Editor(wp) as edit:
&amp;nbsp; with arcpy.da.UpdateCursor(wp,.... ) as updateCursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ....
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateCursor.updateRow(row)
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I restart the feature service and my geoprocessing service in the ArcGIS Server Manager, I can run the tool successfully again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using the SDE.DEFAULT version. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope you help me fix the problem? (or explain the reason)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Dec 2012 18:58:41 GMT</pubDate>
    <dc:creator>MortenHansen</dc:creator>
    <dc:date>2012-12-12T18:58:41Z</dc:date>
    <item>
      <title>ApplyEdits followed by arcpy.da.UpdateCursor</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/applyedits-followed-by-arcpy-da-updatecursor/m-p/224319#M8707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a geoprocessing tool (python script) published to an ArcGIS server 10.1. It updates some features in a feature class. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using a versioned feature class with archiving enabled.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem occurs when the python script tries to update data (in the same feature class):&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
with arcpy.da.Editor(wp) as edit:
&amp;nbsp; with arcpy.da.UpdateCursor(wp,.... ) as updateCursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ....
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateCursor.updateRow(row)
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I restart the feature service and my geoprocessing service in the ArcGIS Server Manager, I can run the tool successfully again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using the SDE.DEFAULT version. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope you help me fix the problem? (or explain the reason)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Dec 2012 18:58:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/applyedits-followed-by-arcpy-da-updatecursor/m-p/224319#M8707</guid>
      <dc:creator>MortenHansen</dc:creator>
      <dc:date>2012-12-12T18:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: ApplyEdits followed by arcpy.da.UpdateCursor</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/applyedits-followed-by-arcpy-da-updatecursor/m-p/224320#M8708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Do I need to close the edit session explicitly after "applyEdits" when working with versioned data?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;And how can I do so (through javascript)?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2012 16:01:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/applyedits-followed-by-arcpy-da-updatecursor/m-p/224320#M8708</guid>
      <dc:creator>MortenHansen</dc:creator>
      <dc:date>2012-12-13T16:01:28Z</dc:date>
    </item>
  </channel>
</rss>

