<?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: arcpy.da.Describe locks geodatabase in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-da-describe-locks-geodatabase/m-p/1239848#M63248</link>
    <description>&lt;P&gt;Found a solution: use a path as the input, instead of a mapping layer object. ALSO, use arcpy.Describe instead of arcpy.da.Describe. Seems a little silly, but it works...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="describe_fix.PNG" style="width: 515px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/58192iD9F1FE7BD049D77F/image-dimensions/515x285?v=v2" width="515" height="285" role="button" title="describe_fix.PNG" alt="describe_fix.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
    <pubDate>Fri, 09 Dec 2022 22:32:59 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2022-12-09T22:32:59Z</dc:date>
    <item>
      <title>arcpy.da.Describe locks geodatabase</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-da-describe-locks-geodatabase/m-p/1236184#M62829</link>
      <description>&lt;P&gt;arcpy.da.Describe seems to put a lock on the layer in a geodatabase. The only way to remove it seems to be closing the script. This doesn't work for me, because I need to gather info from the Describe function, and then depending on the results, move / delete the geodatabase in the same script. I tried deleting the results from the Describe function after I no longer need them, but it's just a dictionary, so it doesn't help.&lt;/P&gt;&lt;P&gt;Here's the basics:&lt;/P&gt;&lt;P&gt;aprx = arcpy.mp.ArcGISProject(path)&lt;BR /&gt;m = aprx.listMaps()[0]&lt;BR /&gt;lyrs = m.listLayers()&lt;BR /&gt;lyr = lyrs[0]&lt;BR /&gt;&lt;BR /&gt;info = arcpy.da.Describe(lyr)&amp;nbsp; &amp;nbsp;# now there's a lock on the feature class that won't go away&lt;BR /&gt;&lt;BR /&gt;# do some other fancy stuff here...&lt;BR /&gt;&lt;BR /&gt;arcpy.management.Delete(gdb_path)&amp;nbsp; # fails because there's a lock on the fc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2022 21:55:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-da-describe-locks-geodatabase/m-p/1236184#M62829</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-11-29T21:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.Describe locks geodatabase</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-da-describe-locks-geodatabase/m-p/1239848#M63248</link>
      <description>&lt;P&gt;Found a solution: use a path as the input, instead of a mapping layer object. ALSO, use arcpy.Describe instead of arcpy.da.Describe. Seems a little silly, but it works...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="describe_fix.PNG" style="width: 515px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/58192iD9F1FE7BD049D77F/image-dimensions/515x285?v=v2" width="515" height="285" role="button" title="describe_fix.PNG" alt="describe_fix.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2022 22:32:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-da-describe-locks-geodatabase/m-p/1239848#M63248</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-12-09T22:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.Describe locks geodatabase</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-da-describe-locks-geodatabase/m-p/1338824#M74068</link>
      <description>&lt;P&gt;I had a similar issue where using the arcpy.da module was creating a lock on my file geodatabase. I see you worked around your problem using &lt;FONT face="courier new,courier"&gt;arcpy.Describe()&lt;/FONT&gt;, but I also discovered you can use &lt;FONT face="courier new,courier"&gt;arcpy.&lt;STRONG&gt;da&lt;/STRONG&gt;.Describe()&lt;/FONT&gt; so long as you use a path as the argument instead of the Layer object and also call another function that seems to force the reset, which in my case was &lt;FONT face="courier new,courier"&gt;arcpy.management.GetCount()&lt;/FONT&gt;.&lt;/P&gt;&lt;P&gt;There seem to be two bugs here. One, when you use the Layer object as an argument to a function like Describe(), whether it's the da module or not, a lock is created that cannot be released. Two, when you use the arcpy.da module, a lock is created that can only be released if using paths to the data since using Layer objects also creates locks. See &lt;A href="https://community.esri.com/t5/arcgis-pro-questions/tabletonumpyarray-creates-schema-lock-in-file/m-p/1337478" target="_blank" rel="noopener"&gt;my post&lt;/A&gt; with additional code samples demonstrating the issues.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 19:40:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-da-describe-locks-geodatabase/m-p/1338824#M74068</guid>
      <dc:creator>isburns</dc:creator>
      <dc:date>2023-10-17T19:40:42Z</dc:date>
    </item>
  </channel>
</rss>

