<?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: Cannot delete FileGeodatabase after Network dataset is created and built in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/cannot-delete-filegeodatabase-after-network/m-p/390741#M30882</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suspect garbage collection by either python or arc*, who knows for sure... sometimes adding a time.sleep solves a problem, sometimes not.&lt;/P&gt;&lt;P&gt;I only get worried if I can't delete something after the script has finished by 'conventional' means, that is through python, Pro tools or the operating system.&lt;/P&gt;&lt;P&gt;So check first, then delete if you have a repetitive workflow makes me worry less but does leave a bit of junk lying around.&amp;nbsp; Just add a secondary standalone 'delete' process to your toolbox (assuming you are creating them) for preparing for an analysis, or to clean up after.&lt;/P&gt;&lt;P&gt;Apparently, gil, threading and python versions cover some of these issues,&amp;nbsp;but I find it just makes my head hurt sometimes &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;&amp;nbsp;&lt;A class="link-titled" href="https://www.python.org/dev/peps/" title="https://www.python.org/dev/peps/"&gt;PEP 0 -- Index of Python Enhancement Proposals (PEPs) | Python.org&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Mar 2020 10:05:38 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2020-03-26T10:05:38Z</dc:date>
    <item>
      <title>Cannot delete FileGeodatabase after Network dataset is created and built</title>
      <link>https://community.esri.com/t5/python-questions/cannot-delete-filegeodatabase-after-network/m-p/390738#M30879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can anyone help me with issue - how to delete the FGDB, in which netwarok dataset was created and built?&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my script I create a temp FGDB with&amp;nbsp;arcpy.CreateFileGDB_management, then&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;import GTFS data, then&lt;/LI&gt;&lt;LI&gt;create Network dataset,&lt;/LI&gt;&lt;LI&gt;which is then built by&amp;nbsp; (in this order).&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This temp FGDB is then copied to another FGDB. The problem is, when I want to delete this temp geodatabase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not able to delete it with &lt;EM&gt;arcpy.Delete_management&lt;/EM&gt;, even if before it I used compact tool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried &lt;EM style="background-color: #ffffff; color: #000000; "&gt;shutil.rmtree("path_to_TempFGDB")&lt;/EM&gt;, but this throws me an error -&amp;nbsp;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;[WinError 32] The process cannot access the file because it is being used by another process:&lt;/EM&gt; '&amp;lt;Path to temp FGDB&amp;gt;\\MMB_NW.gdb\\a00000009.FDO_ID.atx'&amp;nbsp;&lt;/STRONG&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;- still the same file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any idea, why this file is still being locked? Is there any way, how to remove this lock? There is no PRO or another tool which would use the FGDB, just the Python.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for any idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vladimir&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2020 08:31:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-delete-filegeodatabase-after-network/m-p/390738#M30879</guid>
      <dc:creator>VHolubec</dc:creator>
      <dc:date>2020-03-26T08:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot delete FileGeodatabase after Network dataset is created and built</title>
      <link>https://community.esri.com/t5/python-questions/cannot-delete-filegeodatabase-after-network/m-p/390739#M30880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just an general FYI for people reading this looking for solutions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/delete.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/delete.htm"&gt;Delete—Data Management toolbox | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;Feature classes and tables participating in a network analysis dataset or a topology cannot be deleted.&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/appendices/using-the-in-memory-output-workspace.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/appendices/using-the-in-memory-output-workspace.htm"&gt;Considerations when using the in_memory workspace—Appendices | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #f8f8f8;"&gt;The in_memory workspace does not support geodatabase elements such as subtypes, domains, representations, topologies, geometric networks, network datasets, or feature datasets.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Which now raises the question, can the gdb be deleted by conventional means after the script is complete?&lt;/P&gt;&lt;P&gt;If so, one thing to consider in your workflow is to check for the existence of your temporary gdb at the beginning of a script and if it exists, try the delete there.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2020 09:22:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-delete-filegeodatabase-after-network/m-p/390739#M30880</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-03-26T09:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot delete FileGeodatabase after Network dataset is created and built</title>
      <link>https://community.esri.com/t5/python-questions/cannot-delete-filegeodatabase-after-network/m-p/390740#M30881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear &lt;A href="https://community.esri.com/migrated-users/3116"&gt;Dan Patterson&lt;/A&gt;‌, I used this workaround now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought, that it could work, when I want to delete whole FGDB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was just curious, what is the problem here. When I run another standalone script to delete the FGDB with folder (or delete the tempFGDB at the start of the script - as you noted) - then it works fine, but if I run rmtree or another delete tool in the script which made the tempFGDB and Network dataset, I am not able to delete the temp FGDB.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2020 09:31:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-delete-filegeodatabase-after-network/m-p/390740#M30881</guid>
      <dc:creator>VHolubec</dc:creator>
      <dc:date>2020-03-26T09:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot delete FileGeodatabase after Network dataset is created and built</title>
      <link>https://community.esri.com/t5/python-questions/cannot-delete-filegeodatabase-after-network/m-p/390741#M30882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suspect garbage collection by either python or arc*, who knows for sure... sometimes adding a time.sleep solves a problem, sometimes not.&lt;/P&gt;&lt;P&gt;I only get worried if I can't delete something after the script has finished by 'conventional' means, that is through python, Pro tools or the operating system.&lt;/P&gt;&lt;P&gt;So check first, then delete if you have a repetitive workflow makes me worry less but does leave a bit of junk lying around.&amp;nbsp; Just add a secondary standalone 'delete' process to your toolbox (assuming you are creating them) for preparing for an analysis, or to clean up after.&lt;/P&gt;&lt;P&gt;Apparently, gil, threading and python versions cover some of these issues,&amp;nbsp;but I find it just makes my head hurt sometimes &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;&amp;nbsp;&lt;A class="link-titled" href="https://www.python.org/dev/peps/" title="https://www.python.org/dev/peps/"&gt;PEP 0 -- Index of Python Enhancement Proposals (PEPs) | Python.org&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2020 10:05:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-delete-filegeodatabase-after-network/m-p/390741#M30882</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-03-26T10:05:38Z</dc:date>
    </item>
  </channel>
</rss>

