<?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: Persistent state locks in Geodatabase Questions</title>
    <link>https://community.esri.com/t5/geodatabase-questions/persistent-state-locks/m-p/732208#M210</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the links!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No, I don't have performance issues and I don't have to get to state 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm just a little worried that this might signal some inconsistency within the database that'll bite my ass later on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can only see the locks through SQL queries, ArcGIS Pro and ArcCatalog don't show any. Seems like disconnecting all users and compressing could do the trick. I'll talk to my server admin next week.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Sep 2020 13:33:10 GMT</pubDate>
    <dc:creator>JohannesLindner</dc:creator>
    <dc:date>2020-09-04T13:33:10Z</dc:date>
    <item>
      <title>Persistent state locks</title>
      <link>https://community.esri.com/t5/geodatabase-questions/persistent-state-locks/m-p/732206#M208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a versioned EGDB with only the DEFAULT version.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I compress the database, I never get below 8 states. Wondering about this, I investigated a bit and found that I have&amp;nbsp; exclusive state locks&amp;nbsp; from February this year, which stop these states being compressed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;sqlexe &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ArcSDESQLExecute&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;"my\database\connection.sde"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

sqlexe&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;execute&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"SELECT state_id FROM sde.sde_states"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# 8 states&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# [[0.0], [13388.0], [13394.0], [13389.0], [13390.0], [13391.0], [13392.0], [22930.0]]&lt;/SPAN&gt;

query &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"SELECT s.state_id, s.creation_time, s.closing_time, s.parent_state_id,  l.lock_type, l.lock_time FROM sde.sde_states s JOIN sde.sde_state_locks l ON s.state_id = l.state_id"&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; s &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; sqlexe&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;execute&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;query&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;s&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# state_id, creation_time, closing_time, parent_state_id, lock_type, lock_time&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# [13388.0, '07.02.2020 11:36:32', '07.02.2020 11:40:27',     0.0, 'E', '07.02.2020 11:36:32']&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# [13389.0, '07.02.2020 11:40:27', '07.02.2020 11:52:08', 13388.0, 'E', '07.02.2020 11:40:27']&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# [13390.0, '07.02.2020 11:52:08', '07.02.2020 11:55:08', 13389.0, 'E', '07.02.2020 11:52:08']&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# [13391.0, '07.02.2020 11:55:08', '07.02.2020 12:00:17', 13390.0, 'E', '07.02.2020 11:55:08']&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# [13392.0, '07.02.2020 12:00:17', '07.02.2020 12:00:18', 13391.0, 'E', '07.02.2020 12:00:17']&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# [13394.0, '07.02.2020 12:04:34', '07.02.2020 12:04:45',     0.0, 'S', '07.02.2020 13:13:50']&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# [22930.0, '03.09.2020 10:09:39', '03.09.2020 10:09:41', 13394.0, 'S', '03.09.2020 10:09:41']&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# [22930.0, '03.09.2020 10:09:39', '03.09.2020 10:09:41', 13394.0, 'S', '03.09.2020 10:24:06']&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# [22930.0, '03.09.2020 10:09:39', '03.09.2020 10:09:41', 13394.0, 'S', '03.09.2020 10:54:31']&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# [22930.0, '03.09.2020 10:09:39', '03.09.2020 10:09:41', 13394.0, 'S', '03.09.2020 11:14:42']&lt;/SPAN&gt;
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&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;/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;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;/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;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;/P&gt;&lt;OL&gt;&lt;LI&gt;As I understand it, exclusive locks (lock_type 'E') are created when editing data. The locked states have been closed, so the locks should have been lifted, right? What could have caused them to persist?&lt;/LI&gt;&lt;LI&gt;Why does the shared lock (lock_type 'S') persist on state 13394? The current state is accessed by multiple services, but AFAIK there weren't any services running back in February.&amp;nbsp; Is it because it's the parent of the current state?&lt;/LI&gt;&lt;LI&gt;Should I worry about this?&lt;/LI&gt;&lt;LI&gt;How can I get rid of these locks?&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:15:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/persistent-state-locks/m-p/732206#M208</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-12-12T07:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: Persistent state locks</title>
      <link>https://community.esri.com/t5/geodatabase-questions/persistent-state-locks/m-p/732207#M209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The lock behavior could be related to the location of the feature class, i.e. in a Feature Dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://desktop.arcgis.com/en/arcmap/latest/manage-data/geodatabases/schema-locking.htm" title="https://desktop.arcgis.com/en/arcmap/latest/manage-data/geodatabases/schema-locking.htm"&gt;Schema locking—ArcMap | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to get rid:&amp;nbsp;&lt;A class="link-titled" href="https://desktop.arcgis.com/en/arcmap/latest/manage-data/gdbs-in-sql-server/manage-geodatabase-locks.htm" title="https://desktop.arcgis.com/en/arcmap/latest/manage-data/gdbs-in-sql-server/manage-geodatabase-locks.htm"&gt;Manage geodatabase locks—ArcMap | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would not necessarily worry about this unless you are having performance or other issues in the Enterprise Geodatabase times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is the end goal to get to state "0" on a compress?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Sep 2020 11:00:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/persistent-state-locks/m-p/732207#M209</guid>
      <dc:creator>George_Thompson</dc:creator>
      <dc:date>2020-09-04T11:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: Persistent state locks</title>
      <link>https://community.esri.com/t5/geodatabase-questions/persistent-state-locks/m-p/732208#M210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the links!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No, I don't have performance issues and I don't have to get to state 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm just a little worried that this might signal some inconsistency within the database that'll bite my ass later on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can only see the locks through SQL queries, ArcGIS Pro and ArcCatalog don't show any. Seems like disconnecting all users and compressing could do the trick. I'll talk to my server admin next week.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Sep 2020 13:33:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/persistent-state-locks/m-p/732208#M210</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2020-09-04T13:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: Persistent state locks</title>
      <link>https://community.esri.com/t5/geodatabase-questions/persistent-state-locks/m-p/732209#M211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In order to see the locks you have to connect as the Geodatabase administrator and depending on the permissions granted, you can disconnect them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to get a "full" compress, I would recommend stopping all connections to the GDB and pausing the DB, then compress to see what the end result is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This may have to be done during a maintenance window.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Sep 2020 14:30:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/persistent-state-locks/m-p/732209#M211</guid>
      <dc:creator>George_Thompson</dc:creator>
      <dc:date>2020-09-04T14:30:11Z</dc:date>
    </item>
  </channel>
</rss>

