<?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: schema locks with fGDB and python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/schema-locks-with-fgdb-and-python/m-p/1249974#M66607</link>
    <description>&lt;P&gt;The problem still exists but the URLs given in the "solution" no longer exist.&lt;/P&gt;&lt;P&gt;In my case I am trying to DELETE fields, not create them. I also tried using FeatureClassToFeatureClass with a field map. Same result. The target feature class ends up schema locked, it's in a FGDB not a SQL database, and the only way to recover seems to be to quit the Python script, launch Pro, and delete it in Catalog.&lt;/P&gt;&lt;P&gt;The only work around I have found so far is to delete one field at a time, which is slow!&lt;/P&gt;</description>
    <pubDate>Fri, 20 Jan 2023 17:06:02 GMT</pubDate>
    <dc:creator>Brian_Wilson</dc:creator>
    <dc:date>2023-01-20T17:06:02Z</dc:date>
    <item>
      <title>schema locks with fGDB and python</title>
      <link>https://community.esri.com/t5/python-questions/schema-locks-with-fgdb-and-python/m-p/328831#M25576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Just wondering if anyone else has experienced the same as myself and if you have any thoughts/ideas.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I run a python script in a CMD shell running Windows 7 (ArcGIS 10.1).&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The script sets the workspace to...&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.workspace = arcpy.env.scratchGDB&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I copy a table from a given file GDB into the scratchGDB which is another file GDB.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I then attempt to add about 13 fields to the copied table in the scratchGDB.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is the strange part.&amp;nbsp; Often this will work but other times it fails indicating that it could get the schema lock necessary to add the a field.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I didn't know better it almost seems like it's getting ahead of itself whilst looping and trying to get a schema lock before it's finished adding the previous field. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I do not have ArcGIS desktop running, and there does not seem to be any lock files in the scratchGDB prior to executing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Other times it seems to fail while attempting to delete a table or FC from the scratchGDB.&amp;nbsp; Same issue.&amp;nbsp; Can't get the schema lock.&amp;nbsp; Yet most of the time it works just fine when deleting tables/FC from the scratchGDB.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thus far, using python has been a good experience except for the schema lock issues.&amp;nbsp;&amp;nbsp; it seems inconsistent and unpredictable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions or similar experiences welcome.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;brian&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2013 18:06:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/schema-locks-with-fgdb-and-python/m-p/328831#M25576</guid>
      <dc:creator>BKS</dc:creator>
      <dc:date>2013-02-19T18:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: schema locks with fGDB and python</title>
      <link>https://community.esri.com/t5/python-questions/schema-locks-with-fgdb-and-python/m-p/328832#M25577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There have been several posts with this issue in the past with various resolutions. Here are a few.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://forums.arcgis.com/threads/75397-Error-Cannot-get-exclusive-schema-lock" rel="nofollow" target="_blank"&gt;http://forums.arcgis.com/threads/75397-Error-Cannot-get-exclusive-schema-lock&lt;/A&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://forums.arcgis.com/threads/66584-repeated-AddField-operations-fails-in-10.1-works-in-10.0" rel="nofollow" target="_blank"&gt;http://forums.arcgis.com/threads/66584-repeated-AddField-operations-fails-in-10.1-works-in-10.0&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2013 18:18:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/schema-locks-with-fgdb-and-python/m-p/328832#M25577</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2013-02-19T18:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: schema locks with fGDB and python</title>
      <link>https://community.esri.com/t5/python-questions/schema-locks-with-fgdb-and-python/m-p/1249974#M66607</link>
      <description>&lt;P&gt;The problem still exists but the URLs given in the "solution" no longer exist.&lt;/P&gt;&lt;P&gt;In my case I am trying to DELETE fields, not create them. I also tried using FeatureClassToFeatureClass with a field map. Same result. The target feature class ends up schema locked, it's in a FGDB not a SQL database, and the only way to recover seems to be to quit the Python script, launch Pro, and delete it in Catalog.&lt;/P&gt;&lt;P&gt;The only work around I have found so far is to delete one field at a time, which is slow!&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2023 17:06:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/schema-locks-with-fgdb-and-python/m-p/1249974#M66607</guid>
      <dc:creator>Brian_Wilson</dc:creator>
      <dc:date>2023-01-20T17:06:02Z</dc:date>
    </item>
  </channel>
</rss>

