<?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: Disconnect from SDE in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/disconnect-from-sde/m-p/231757#M17968</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;arcpy.DisconnectUser() disconnects other users, not the current administrative user.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It would, I suppose, be possible to use an administrative connection to disconnect non-administrative connection,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;but that only works (if it does at all in this scenario) if the user is an administrative user &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It would be good to have a way to disconnect oneself from an SDE database:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;one can do it interactively in ArcCatalog....&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Jun 2014 18:18:55 GMT</pubDate>
    <dc:creator>markdenil</dc:creator>
    <dc:date>2014-06-20T18:18:55Z</dc:date>
    <item>
      <title>Disconnect from SDE</title>
      <link>https://community.esri.com/t5/python-questions/disconnect-from-sde/m-p/231755#M17966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am working in an enterprise geodatabase in through Citrix - both the desktop client and SDE are at 10.1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I often have multiple SDE connections open and would like a way to close all of them at once rather than right clicking on each one and selecting disconnect. I don't see any close or disconnect methods and the arcpy.ClearWorkspaceCache_Management() method does not close the connection in the ArcCatalog tree. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone know if there is a way to do this using Python?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 20:09:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/disconnect-from-sde/m-p/231755#M17966</guid>
      <dc:creator>DavidWatkins2</dc:creator>
      <dc:date>2014-06-18T20:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: Disconnect from SDE</title>
      <link>https://community.esri.com/t5/python-questions/disconnect-from-sde/m-p/231756#M17967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Something like this maybe?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy

connectionFile = r"&amp;lt;path\to&amp;gt;\connection.sde"

#block new connections to the database.
arcpy.AcceptConnections(connectionFile, False)

#disconnect all users from the database.
arcpy.DisconnectUser(connectionFile, "ALL")

# do work here

#allow new connections to the database.
arcpy.AcceptConnections(connectionFile, True)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:44:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/disconnect-from-sde/m-p/231756#M17967</guid>
      <dc:creator>PaulSchneider</dc:creator>
      <dc:date>2021-12-11T11:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Disconnect from SDE</title>
      <link>https://community.esri.com/t5/python-questions/disconnect-from-sde/m-p/231757#M17968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;arcpy.DisconnectUser() disconnects other users, not the current administrative user.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It would, I suppose, be possible to use an administrative connection to disconnect non-administrative connection,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;but that only works (if it does at all in this scenario) if the user is an administrative user &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It would be good to have a way to disconnect oneself from an SDE database:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;one can do it interactively in ArcCatalog....&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2014 18:18:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/disconnect-from-sde/m-p/231757#M17968</guid>
      <dc:creator>markdenil</dc:creator>
      <dc:date>2014-06-20T18:18:55Z</dc:date>
    </item>
  </channel>
</rss>

