<?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 Managing attribute domains that have schema locks in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/managing-attribute-domains-that-have-schema-locks/m-p/186863#M10518</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have an attribute domain that will need to be updated on a regular basis as new values are added to a master table of street names, and we are trying to find a way to script out the updating of it. Now the issue is this domain is assigned to fields in several feature classes that will almost always have schema locks on them from users leaving ArcMap documents open and some map services.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have tried several versions of a workflow in our Python script; but it always ends up reporting the same error at some point:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ERROR 000464: Cannot get exclusive schema lock.&amp;nbsp; Either being edited or in use by another application.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Our first attempt was to simply use the Table to Domain tool to overwrite the existing domain values; but that crashes due to the error.&lt;/LI&gt;&lt;LI&gt;Secondly, we tried to first remove the domain from the pertinent feature class fields, then use Table to Domain to replace the domain values; but the script throws the error when trying to reassign the domain to the needed fields.&lt;/LI&gt;&lt;LI&gt;Our other possibility was to generate a list of all the current domain values, delete those values from the domain, and then append in the new values with Table to Domain (thinking that maybe appending instead of overwriting on the domain would solve it); but the error appears here when trying to delete the existing values from the domain.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;When our nightly update scripts run there will almost always be some schema locks on that domain; so we need to find a way to update the domain with those present if possible. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wondering if anyone has run into a similar issue and found a workflow that gets around those pesky schema locks?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Britt&lt;/P&gt;&lt;P&gt;GIS Technician&lt;/P&gt;&lt;P&gt;City of Auburn, AL&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Feb 2015 17:10:15 GMT</pubDate>
    <dc:creator>BrittJohnson</dc:creator>
    <dc:date>2015-02-13T17:10:15Z</dc:date>
    <item>
      <title>Managing attribute domains that have schema locks</title>
      <link>https://community.esri.com/t5/data-management-questions/managing-attribute-domains-that-have-schema-locks/m-p/186863#M10518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have an attribute domain that will need to be updated on a regular basis as new values are added to a master table of street names, and we are trying to find a way to script out the updating of it. Now the issue is this domain is assigned to fields in several feature classes that will almost always have schema locks on them from users leaving ArcMap documents open and some map services.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have tried several versions of a workflow in our Python script; but it always ends up reporting the same error at some point:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ERROR 000464: Cannot get exclusive schema lock.&amp;nbsp; Either being edited or in use by another application.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Our first attempt was to simply use the Table to Domain tool to overwrite the existing domain values; but that crashes due to the error.&lt;/LI&gt;&lt;LI&gt;Secondly, we tried to first remove the domain from the pertinent feature class fields, then use Table to Domain to replace the domain values; but the script throws the error when trying to reassign the domain to the needed fields.&lt;/LI&gt;&lt;LI&gt;Our other possibility was to generate a list of all the current domain values, delete those values from the domain, and then append in the new values with Table to Domain (thinking that maybe appending instead of overwriting on the domain would solve it); but the error appears here when trying to delete the existing values from the domain.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;When our nightly update scripts run there will almost always be some schema locks on that domain; so we need to find a way to update the domain with those present if possible. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wondering if anyone has run into a similar issue and found a workflow that gets around those pesky schema locks?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Britt&lt;/P&gt;&lt;P&gt;GIS Technician&lt;/P&gt;&lt;P&gt;City of Auburn, AL&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 17:10:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/managing-attribute-domains-that-have-schema-locks/m-p/186863#M10518</guid>
      <dc:creator>BrittJohnson</dc:creator>
      <dc:date>2015-02-13T17:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: Managing attribute domains that have schema locks</title>
      <link>https://community.esri.com/t5/data-management-questions/managing-attribute-domains-that-have-schema-locks/m-p/186864#M10519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you ever get an answer? I'm running into the same issue here. &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/confused.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2015 15:58:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/managing-attribute-domains-that-have-schema-locks/m-p/186864#M10519</guid>
      <dc:creator>VenusScott</dc:creator>
      <dc:date>2015-05-06T15:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: Managing attribute domains that have schema locks</title>
      <link>https://community.esri.com/t5/data-management-questions/managing-attribute-domains-that-have-schema-locks/m-p/186865#M10520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Venus, we haven't gotten any answer to this issue so far. We're still having to manually kill locks and update the domains as-needed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2015 16:04:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/managing-attribute-domains-that-have-schema-locks/m-p/186865#M10520</guid>
      <dc:creator>BrittJohnson</dc:creator>
      <dc:date>2015-05-06T16:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: Managing attribute domains that have schema locks</title>
      <link>https://community.esri.com/t5/data-management-questions/managing-attribute-domains-that-have-schema-locks/m-p/186866#M10521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bummer. If I find out anything, I'll post it. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2015 16:19:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/managing-attribute-domains-that-have-schema-locks/m-p/186866#M10521</guid>
      <dc:creator>VenusScott</dc:creator>
      <dc:date>2015-05-06T16:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: Managing attribute domains that have schema locks</title>
      <link>https://community.esri.com/t5/data-management-questions/managing-attribute-domains-that-have-schema-locks/m-p/186867#M10522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Britt,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you looked into blocking connections to your database then disconnecting all users? &amp;nbsp;You would need SDE or DBO level rights on your geodatabase. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your script would connect using SDE or DBO and that connection would remain active. &amp;nbsp;However, you would ensure no additional locks by blocking connections and disconnecting all users:&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
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; time
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcpy &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; env

&lt;SPAN class="comment token"&gt;# Connection to database (SDE User), set workspace&lt;/SPAN&gt;
database_conn &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'Database Connections\Enterprise.sde'&lt;/SPAN&gt;
env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; database_conn

&lt;SPAN class="comment token"&gt;# Block new connections to the database.&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;try&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Blocking connections in %s'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;%&lt;/SPAN&gt; database_conn
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AcceptConnections&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;except&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ExecuteError&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ExecuteWarning&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; e&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; e
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Blocked all connections'&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# wait 60 seconds&lt;/SPAN&gt;
time&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;sleep&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;60&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Disconnect all users from the database.&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;try&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Disconnecting all users from %s...'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;%&lt;/SPAN&gt; database_conn
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;DisconnectUser&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ALL"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;except&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ExecuteError&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ExecuteWarning&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; e&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; e
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Disconnected all users'&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# RUN ADDITIONAL PROCESSING HERE&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Allow the database to begin accepting connections again&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;try&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Accepting Connections from %s...'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;%&lt;/SPAN&gt; database_conn
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AcceptConnections&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;except&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ExecuteError&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ExecuteWarning&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; e&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; e

‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&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;/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;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:27:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/managing-attribute-domains-that-have-schema-locks/m-p/186867#M10522</guid>
      <dc:creator>AlexanderBrown5</dc:creator>
      <dc:date>2021-12-11T09:27:52Z</dc:date>
    </item>
  </channel>
</rss>

