<?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: Checking SDE Connections for an Edit Session in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/checking-sde-connections-for-an-edit-session/m-p/672631#M52042</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found this, which may have some things to try&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://gis.stackexchange.com/questions/61708/checking-via-arcpy-if-arcmap-is-in-edit-session" title="https://gis.stackexchange.com/questions/61708/checking-via-arcpy-if-arcmap-is-in-edit-session" rel="nofollow noopener noreferrer" target="_blank"&gt;Checking via ArcPy if ArcMap is in edit session? - Geographic Information Systems Stack Exchange&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This may be more of an ArcMap tool, but I'm looking at it too since testing for edit sessions would be handy for me too (right now, I manually use the SDE Database administrator and look for locks).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have seen other post tools for running nightly rec/post and compress too, and my guess is they check for edit sessions too.&amp;nbsp; I don't have one of those thread at my finger tips, but might be worth a search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My guess is you've already seend the help to get a list of the&amp;nbsp;&lt;EM&gt;connected&lt;/EM&gt; users.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/manage-data/gdbs-in-sql-server/manage-connections-sqlserver.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/manage-data/gdbs-in-sql-server/manage-connections-sqlserver.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Manage connections in SQL Server—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Think I found it......I'm testing and will add a post&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT:&amp;nbsp; this looks like it should work, but I'm getting False even after opening a session.&amp;nbsp; I am testing against a version SDE with topology.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy

myConn &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'Database Connections\me@myData.sde'&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Editor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;myConn&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;isEditing
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-data-access/editor.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-data-access/editor.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Editor—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;btw - I converted you document to a question.&amp;nbsp; You should get more views/responses.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 04:24:06 GMT</pubDate>
    <dc:creator>RebeccaStrauch__GISP</dc:creator>
    <dc:date>2021-12-12T04:24:06Z</dc:date>
    <item>
      <title>Checking SDE Connections for an Edit Session</title>
      <link>https://community.esri.com/t5/python-questions/checking-sde-connections-for-an-edit-session/m-p/672630#M52041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am implementing Esri's python script to batch reconcile and post versions of our Enterprise Geodatabase running on SQL Server. &amp;nbsp;The script is found &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/manage-data/geodatabases/using-python-scripting-to-batch-reconcile-and-post-versions.htm"&gt;here&lt;/A&gt; and would be run from our server using Task Scheduler.&amp;nbsp; Instead of automatically disconnecting users from the database after a set period, we would like to check whether a user has an open edit session going.&amp;nbsp; If there is an active edit session, instead of disconnecting the user and losing any edits they may have made, the script would not be run.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently, the script set to run only if there are no other users connected besides the administrator, i.e. if a Map Document is left open overnight on a Desktop the script won't run.&amp;nbsp; This is a blanket fix and I would prefer that the script still run if the open map document isn’t being actively edited.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to check if a user connected to the database is in an edit session?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Nov 2017 00:13:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/checking-sde-connections-for-an-edit-session/m-p/672630#M52041</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2017-11-22T00:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Checking SDE Connections for an Edit Session</title>
      <link>https://community.esri.com/t5/python-questions/checking-sde-connections-for-an-edit-session/m-p/672631#M52042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found this, which may have some things to try&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://gis.stackexchange.com/questions/61708/checking-via-arcpy-if-arcmap-is-in-edit-session" title="https://gis.stackexchange.com/questions/61708/checking-via-arcpy-if-arcmap-is-in-edit-session" rel="nofollow noopener noreferrer" target="_blank"&gt;Checking via ArcPy if ArcMap is in edit session? - Geographic Information Systems Stack Exchange&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This may be more of an ArcMap tool, but I'm looking at it too since testing for edit sessions would be handy for me too (right now, I manually use the SDE Database administrator and look for locks).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have seen other post tools for running nightly rec/post and compress too, and my guess is they check for edit sessions too.&amp;nbsp; I don't have one of those thread at my finger tips, but might be worth a search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My guess is you've already seend the help to get a list of the&amp;nbsp;&lt;EM&gt;connected&lt;/EM&gt; users.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/manage-data/gdbs-in-sql-server/manage-connections-sqlserver.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/manage-data/gdbs-in-sql-server/manage-connections-sqlserver.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Manage connections in SQL Server—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Think I found it......I'm testing and will add a post&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT:&amp;nbsp; this looks like it should work, but I'm getting False even after opening a session.&amp;nbsp; I am testing against a version SDE with topology.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy

myConn &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'Database Connections\me@myData.sde'&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Editor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;myConn&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;isEditing
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-data-access/editor.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-data-access/editor.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Editor—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;btw - I converted you document to a question.&amp;nbsp; You should get more views/responses.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:24:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/checking-sde-connections-for-an-edit-session/m-p/672631#M52042</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2021-12-12T04:24:06Z</dc:date>
    </item>
  </channel>
</rss>

