<?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 How to do Editor abort on AGOL REST endpoint in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-do-editor-abort-on-agol-rest-endpoint/m-p/144102#M11186</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a python program does does a series of updates on a group of feature classes that it accesses via an ArcGIS online REST endpoint that proxies the request to my ArcGIS server. I want to be able to back out the updates if something goes wrong but I can't get it to work. I reduced the code as shown below. The code sets an initial value , performs 3 updates (each with a new cursor, since in my real code I have to make multiple passes over the data), then aborts the edit session. If I run this against a file geodatabase it works as expected where at the end the records have the "original value". However if I run it against the ArcGIS Online REST endpoint it ends up with the 2nd update ('Edited -2') - as if only the data updated by the last cursor was backed off.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;I'm running this with arcpy that got installed with ArcPro (currently at 2.4.2)&amp;nbsp; and Python 3.6.8 and Advanced license.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;import arcpy&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;workspace = 'https://utility.arcgis.com/usrsvcs/servers/383d3cf85e8a41e9b7e8a5e9e8bb90b9/rest/services/ROW_testing/ERC/FeatureServer'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;fc = workspace + '/0'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;# Set initial values&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;with arcpy.da.UpdateCursor(fc, ['LineName']) as cursor:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;&amp;nbsp; &amp;nbsp; for row in cursor:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cursor.updateRow(['Original value'])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;edit = arcpy.da.Editor(workspace)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;edit.startEditing(True, False)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;edit.startOperation()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;with arcpy.da.UpdateCursor(fc, ['LineName']) as cursor:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;&amp;nbsp; &amp;nbsp; for row in cursor:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cursor.updateRow(['Edited - 1'])&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;with arcpy.da.UpdateCursor(fc, ['LineName']) as cursor:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;&amp;nbsp; &amp;nbsp; for row in cursor:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cursor.updateRow(['Edited - 2'])&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;with arcpy.da.UpdateCursor(fc, ['LineName']) as cursor:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;&amp;nbsp; &amp;nbsp; for row in cursor:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cursor.updateRow(['Edited - 3']) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;edit.abortOperation()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;edit.stopEditing(False)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Dec 2019 20:09:20 GMT</pubDate>
    <dc:creator>DonMorrison1</dc:creator>
    <dc:date>2019-12-05T20:09:20Z</dc:date>
    <item>
      <title>How to do Editor abort on AGOL REST endpoint</title>
      <link>https://community.esri.com/t5/python-questions/how-to-do-editor-abort-on-agol-rest-endpoint/m-p/144102#M11186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a python program does does a series of updates on a group of feature classes that it accesses via an ArcGIS online REST endpoint that proxies the request to my ArcGIS server. I want to be able to back out the updates if something goes wrong but I can't get it to work. I reduced the code as shown below. The code sets an initial value , performs 3 updates (each with a new cursor, since in my real code I have to make multiple passes over the data), then aborts the edit session. If I run this against a file geodatabase it works as expected where at the end the records have the "original value". However if I run it against the ArcGIS Online REST endpoint it ends up with the 2nd update ('Edited -2') - as if only the data updated by the last cursor was backed off.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;I'm running this with arcpy that got installed with ArcPro (currently at 2.4.2)&amp;nbsp; and Python 3.6.8 and Advanced license.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;import arcpy&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;workspace = 'https://utility.arcgis.com/usrsvcs/servers/383d3cf85e8a41e9b7e8a5e9e8bb90b9/rest/services/ROW_testing/ERC/FeatureServer'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;fc = workspace + '/0'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;# Set initial values&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;with arcpy.da.UpdateCursor(fc, ['LineName']) as cursor:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;&amp;nbsp; &amp;nbsp; for row in cursor:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cursor.updateRow(['Original value'])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;edit = arcpy.da.Editor(workspace)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;edit.startEditing(True, False)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;edit.startOperation()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;with arcpy.da.UpdateCursor(fc, ['LineName']) as cursor:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;&amp;nbsp; &amp;nbsp; for row in cursor:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cursor.updateRow(['Edited - 1'])&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;with arcpy.da.UpdateCursor(fc, ['LineName']) as cursor:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;&amp;nbsp; &amp;nbsp; for row in cursor:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cursor.updateRow(['Edited - 2'])&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;with arcpy.da.UpdateCursor(fc, ['LineName']) as cursor:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;&amp;nbsp; &amp;nbsp; for row in cursor:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cursor.updateRow(['Edited - 3']) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;edit.abortOperation()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 13px;"&gt;edit.stopEditing(False)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Dec 2019 20:09:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-do-editor-abort-on-agol-rest-endpoint/m-p/144102#M11186</guid>
      <dc:creator>DonMorrison1</dc:creator>
      <dc:date>2019-12-05T20:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Editor abort on AGOL REST endpoint</title>
      <link>https://community.esri.com/t5/python-questions/how-to-do-editor-abort-on-agol-rest-endpoint/m-p/144103#M11187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It turns out that Undo is not supported when editing a web layer - according to this &lt;A href="https://pro.arcgis.com/en/pro-app/help/data/services/use-web-feature-layers.htm#ESRI_SECTION1_6EB623C1E0BD4A58A9BD42BF000BBF86"&gt;help document&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a suggestion &lt;A _jive_internal="true" href="https://community.esri.com/ideas/9583"&gt;here &lt;/A&gt;to add that support&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Dec 2019 12:50:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-do-editor-abort-on-agol-rest-endpoint/m-p/144103#M11187</guid>
      <dc:creator>DonMorrison1</dc:creator>
      <dc:date>2019-12-16T12:50:27Z</dc:date>
    </item>
  </channel>
</rss>

