<?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 ArcSDE/Oracle connection management from Python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcsde-oracle-connection-management-from-python/m-p/102511#M7902</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am a user with non-admin rights on a versioned ArcSDE Oracle geodatabase. I am writing a Python 2.6 script, and running it in ArcGIS 10.0 SP4. The script opens a connection from an .SDE file. I need to do some connection management, since during the debugging process the script crashes, leaves open connections on the SDE server, and eventually I get schema lock error messages, requiring that the gdb admin kill the open sessions in the server. Is there a way to manage these connections from my Python script, and to remove them either at the end of a successful script or run, or within a finally clause in a try-catch-finally code block?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Jan 2013 15:10:12 GMT</pubDate>
    <dc:creator>JuanDeclet-Barreto</dc:creator>
    <dc:date>2013-01-23T15:10:12Z</dc:date>
    <item>
      <title>ArcSDE/Oracle connection management from Python</title>
      <link>https://community.esri.com/t5/python-questions/arcsde-oracle-connection-management-from-python/m-p/102511#M7902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am a user with non-admin rights on a versioned ArcSDE Oracle geodatabase. I am writing a Python 2.6 script, and running it in ArcGIS 10.0 SP4. The script opens a connection from an .SDE file. I need to do some connection management, since during the debugging process the script crashes, leaves open connections on the SDE server, and eventually I get schema lock error messages, requiring that the gdb admin kill the open sessions in the server. Is there a way to manage these connections from my Python script, and to remove them either at the end of a successful script or run, or within a finally clause in a try-catch-finally code block?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2013 15:10:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcsde-oracle-connection-management-from-python/m-p/102511#M7902</guid>
      <dc:creator>JuanDeclet-Barreto</dc:creator>
      <dc:date>2013-01-23T15:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: ArcSDE/Oracle connection management from Python</title>
      <link>https://community.esri.com/t5/python-questions/arcsde-oracle-connection-management-from-python/m-p/102512#M7903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Are you using cursors? If so, be sure to delete your cursor objects:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#in v9.3 and v10.0&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;try:
&amp;nbsp;&amp;nbsp; searchRows = gp/arcpy.SearchCursor(blah, blah)
&amp;nbsp;&amp;nbsp; for searchRow in searchRows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; blah
&amp;nbsp;&amp;nbsp; del searchRow, searchRows
except:&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; del searchRow, searchRows&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In v10.1 you can use the with statement with the new .da cursors to ensure release of locks: &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//018w00000011000000" rel="nofollow noopener noreferrer" target="_blank"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//018w00000011000000&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:19:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcsde-oracle-connection-management-from-python/m-p/102512#M7903</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2021-12-11T06:19:00Z</dc:date>
    </item>
  </channel>
</rss>

