<?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 Re: Objects in this class cannot be updated outside an edit session in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/objects-in-this-class-cannot-be-updated-outside-an/m-p/479668#M37527</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I should mention this is my new code, I added the change version piece:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# Set the necessary product code
import arceditor

# Import arcpy module
import arcpy
arg_sdeDEV_sde = "Database Connections\\arg@sdeDEV.sde"
ARG_ACCESS_OPENING = "Database Connections\\arg@sdeDEV.sde\\ARG.DistributionSystem\\ARG.ACCESS_OPENING"
ACCESS_OPENING_Layer = "ACCESS_OPENING_Layer"
Reconcile_Versions_Log = ""

# Process: Make Feature Layer
tempEnvironment0 = arcpy.env.workspace
arcpy.env.workspace = "Database Connections\\arg@sdeDEV.sde"
arcpy.env.overwriteOutput = True
arcpy.MakeFeatureLayer_management(ARG_ACCESS_OPENING, ACCESS_OPENING_Layer, "", arg_sdeDEV_sde, "OBJECTID OBJECTID VISIBLE NONE;OPEN_TYPE OPEN_TYPE VISIBLE NONE;REC_INFO_NAME REC_INFO_NAME VISIBLE NONE")
arcpy.env.workspace = tempEnvironment0

# Process: Change Version
arcpy.ChangeVersion_management(ACCESS_OPENING_Layer, "TRANSACTIONAL", "ARG.ARG_PARENT", "")

# Process: Start Edit
edit = arcpy.da.Editor(arcpy.env.workspace)
edit.startEditing(False, True)
edit.startOperation()

# Process: Select and Update Data
cursor = arcpy.UpdateCursor(ARG_ACCESS_OPENING)
for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp; row.setValue("STRUCTURE_ID", row.getValue("ENCLOSURE_ID"))
&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.updateRow(row)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 21:10:50 GMT</pubDate>
    <dc:creator>JordanParfitt</dc:creator>
    <dc:date>2021-12-11T21:10:50Z</dc:date>
    <item>
      <title>Objects in this class cannot be updated outside an edit session</title>
      <link>https://community.esri.com/t5/python-questions/objects-in-this-class-cannot-be-updated-outside-an/m-p/479665#M37524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I keeping getting the "Objects in this class cannot be updated outside an edit session" error message. I can't figure out why because it seems to be I'm opening an edit session. Is there a step I'm missing?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you in advance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt; arg_sdeDEV_sde = "Database Connections\\arg@sdeDEV.sde" ARG_ACCESS_OPENING = "Database Connections\\arg@sdeDEV.sde\\ARG.DistributionSystem\\ARG.ACCESS_OPENING" ACCESS_OPENING_Layer = "ACCESS_OPENING_Layer" Reconcile_Versions_Log = ""&amp;nbsp;&amp;nbsp; # Process: Make Feature Layer tempEnvironment0 = arcpy.env.workspace arcpy.env.workspace = "Database Connections\\arg@sdeDEV.sde" arcpy.env.overwriteOutput = True arcpy.MakeFeatureLayer_management(ARG_ACCESS_OPENING, ACCESS_OPENING_Layer, "", arg_sdeDEV_sde, "OBJECTID OBJECTID VISIBLE NONE;OPEN_TYPE OPEN_TYPE VISIBLE NONE;REC_INFO_NAME REC_INFO_NAME VISIBLE NONE") arcpy.env.workspace = tempEnvironment0&amp;nbsp; # Process: Start Edit edit = arcpy.da.Editor(arcpy.env.workspace) edit.startEditing(True, False) edit.startOperation()&amp;nbsp; # Process: Select and Update Data cursor = arcpy.UpdateCursor(ARG_ACCESS_OPENING) for row in cursor: &amp;nbsp;&amp;nbsp;&amp;nbsp; row.setValue("STRUCTURE_ID", row.getValue("ENCLOSURE_ID")) &amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.updateRow(row)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 14:53:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/objects-in-this-class-cannot-be-updated-outside-an/m-p/479665#M37524</guid>
      <dc:creator>JordanParfitt</dc:creator>
      <dc:date>2014-02-07T14:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: Objects in this class cannot be updated outside an edit session</title>
      <link>https://community.esri.com/t5/python-questions/objects-in-this-class-cannot-be-updated-outside-an/m-p/479666#M37525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;startEditing ({with_undo}, {multiuser_mode})&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for with_undo, start session without an undo/redo stack for versioned data&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; for multiuser_mod, use False for unversioned data&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If your sde layer is versioned, you might try&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;edit.startEditing(False, True)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Feb 2014 06:30:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/objects-in-this-class-cannot-be-updated-outside-an/m-p/479666#M37525</guid>
      <dc:creator>NeoGeo</dc:creator>
      <dc:date>2014-02-08T06:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: Objects in this class cannot be updated outside an edit session</title>
      <link>https://community.esri.com/t5/python-questions/objects-in-this-class-cannot-be-updated-outside-an/m-p/479667#M37526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When I do edit.startEditing(False, True) it breaks on that same line and I get the error "Operation only allowed by the owner of the version [SDE.DEFAULT]"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's almost like it's not changing the version when I execute this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
# Process: Change Version
arcpy.ChangeVersion_management(ACCESS_OPENING_Layer, "TRANSACTIONAL", "ARG.ARG_PARENT", "")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:10:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/objects-in-this-class-cannot-be-updated-outside-an/m-p/479667#M37526</guid>
      <dc:creator>JordanParfitt</dc:creator>
      <dc:date>2021-12-11T21:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: Objects in this class cannot be updated outside an edit session</title>
      <link>https://community.esri.com/t5/python-questions/objects-in-this-class-cannot-be-updated-outside-an/m-p/479668#M37527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I should mention this is my new code, I added the change version piece:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# Set the necessary product code
import arceditor

# Import arcpy module
import arcpy
arg_sdeDEV_sde = "Database Connections\\arg@sdeDEV.sde"
ARG_ACCESS_OPENING = "Database Connections\\arg@sdeDEV.sde\\ARG.DistributionSystem\\ARG.ACCESS_OPENING"
ACCESS_OPENING_Layer = "ACCESS_OPENING_Layer"
Reconcile_Versions_Log = ""

# Process: Make Feature Layer
tempEnvironment0 = arcpy.env.workspace
arcpy.env.workspace = "Database Connections\\arg@sdeDEV.sde"
arcpy.env.overwriteOutput = True
arcpy.MakeFeatureLayer_management(ARG_ACCESS_OPENING, ACCESS_OPENING_Layer, "", arg_sdeDEV_sde, "OBJECTID OBJECTID VISIBLE NONE;OPEN_TYPE OPEN_TYPE VISIBLE NONE;REC_INFO_NAME REC_INFO_NAME VISIBLE NONE")
arcpy.env.workspace = tempEnvironment0

# Process: Change Version
arcpy.ChangeVersion_management(ACCESS_OPENING_Layer, "TRANSACTIONAL", "ARG.ARG_PARENT", "")

# Process: Start Edit
edit = arcpy.da.Editor(arcpy.env.workspace)
edit.startEditing(False, True)
edit.startOperation()

# Process: Select and Update Data
cursor = arcpy.UpdateCursor(ARG_ACCESS_OPENING)
for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp; row.setValue("STRUCTURE_ID", row.getValue("ENCLOSURE_ID"))
&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.updateRow(row)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:10:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/objects-in-this-class-cannot-be-updated-outside-an/m-p/479668#M37527</guid>
      <dc:creator>JordanParfitt</dc:creator>
      <dc:date>2021-12-11T21:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: Objects in this class cannot be updated outside an edit session</title>
      <link>https://community.esri.com/t5/python-questions/objects-in-this-class-cannot-be-updated-outside-an/m-p/479669#M37528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I created a new SDE connection with the default version pointing to the version I wanted to edit, eliminating the need to change versions pro grammatically. Hope this helps someone else.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Jordan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Feb 2014 13:32:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/objects-in-this-class-cannot-be-updated-outside-an/m-p/479669#M37528</guid>
      <dc:creator>JordanParfitt</dc:creator>
      <dc:date>2014-02-12T13:32:31Z</dc:date>
    </item>
    <item>
      <title>Re: Objects in this class cannot be updated outside an edit session</title>
      <link>https://community.esri.com/t5/python-questions/objects-in-this-class-cannot-be-updated-outside-an/m-p/1031945#M60178</link>
      <description>Reply moved and started as a new question since issue isn't ArcPy or Python related.</description>
      <pubDate>Tue, 02 Mar 2021 09:14:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/objects-in-this-class-cannot-be-updated-outside-an/m-p/1031945#M60178</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-03-02T09:14:26Z</dc:date>
    </item>
  </channel>
</rss>

