<?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: How do I reestablish a database connection after compressing in a script? in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/how-do-i-reestablish-a-database-connection-after/m-p/18565#M999</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;GREAT question. I am having the exact same issue. Hoping ESRI can provide some insight.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 May 2019 15:56:47 GMT</pubDate>
    <dc:creator>MichaelRomankiewicz</dc:creator>
    <dc:date>2019-05-30T15:56:47Z</dc:date>
    <item>
      <title>How do I reestablish a database connection after compressing in a script?</title>
      <link>https://community.esri.com/t5/data-management-questions/how-do-i-reestablish-a-database-connection-after/m-p/18564#M998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a script that needs to run a database compression in the middle so that I can run a SQL update statement. I allow new connections again after the compression, but the script fails because it can't see the database any longer. Is there any way to force the script to reconnect to the database after?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's a sample of the code. The first Exists shows the feature class is there, but the second one can't see it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;if arcpy.Exists(ACCOUNTS):&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;print "ACCOUNTS exists"&lt;BR /&gt;else: print "ACCOUNTS doesn't exist"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.AcceptConnections(SDE_Connection, False)&lt;BR /&gt;arcpy.DisconnectUser(SDE_Connection, "ALL")&lt;BR /&gt;arcpy.Compress_management(SDE_Connection)&lt;BR /&gt;arcpy.AcceptConnections(SDE_Connection, True)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if arcpy.Exists(ACCOUNTS):&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;print "ACCOUNTS exists"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;else: print "ACCOUNTS doesn't exist"&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2019 15:26:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/how-do-i-reestablish-a-database-connection-after/m-p/18564#M998</guid>
      <dc:creator>HenryBernberg</dc:creator>
      <dc:date>2019-05-30T15:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I reestablish a database connection after compressing in a script?</title>
      <link>https://community.esri.com/t5/data-management-questions/how-do-i-reestablish-a-database-connection-after/m-p/18565#M999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;GREAT question. I am having the exact same issue. Hoping ESRI can provide some insight.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2019 15:56:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/how-do-i-reestablish-a-database-connection-after/m-p/18565#M999</guid>
      <dc:creator>MichaelRomankiewicz</dc:creator>
      <dc:date>2019-05-30T15:56:47Z</dc:date>
    </item>
  </channel>
</rss>

