<?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... May be locked by another application. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511493#M40172</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did anyone get an answer to this. I am having the same issue however I am not using a search cursor at all I am using a delete&amp;nbsp; feature.. it is deleting one feature (DB2) and then moving feature 1 DB1 to DB2 where the previous feature was deleted. I keep getting this error as well. it makes no sense. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Mar 2015 19:27:48 GMT</pubDate>
    <dc:creator>lelaharrington</dc:creator>
    <dc:date>2015-03-12T19:27:48Z</dc:date>
    <item>
      <title>Cannot delete... May be locked by another application.</title>
      <link>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511481#M40160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've written a long script that selects a bunch of different feature classes and exports them to a file geodatabase by an attribute. Then I export those feature classes to shapefiles. Next, I zip the geodatabase into its own file and all the shapes into their own file. Finally, I delete the geodatabase and shapes so that all I'm left with is the 2 zip files (We do this for a FEMA product) in the output folder. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;No problems. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Recently I learned that I needed to include several tables in the database as well, so I inserted some code that searches one table for an attribute and writes the output to a list. Then I use that list to query ANOTHER table to create a table in the database.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem is, now with this new bit of code, the geodatabase will not delete and I receive ExecuteError: ERROR 000601: Cannot delete C:\~Working\FRIS\Test2\Alamance\NCFlood_Prelim_Alamance_GDB.gdb. May be locked by another application. Failed to execute (Delete).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;New bit of code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# L_COMM_INFO
CIDList = []
S_POL_AR = os.path.join(FRIS_FGDB, "S_POL_AR")
S_POL_ARTable = arcpy.SearchCursor(S_POL_AR)
for ID in S_POL_ARTable:
&amp;nbsp;&amp;nbsp;&amp;nbsp; FIELD = "CID"
&amp;nbsp;&amp;nbsp;&amp;nbsp; Val = ID.getValue(FIELD)
&amp;nbsp;&amp;nbsp;&amp;nbsp; CIDList.append(Val)
NewCIDList = list(set(CIDList))

L_COMMUNITY_INFO = "Database Connections\NC_FLOOD.sde\NC_FLOOD.DBO.L_COMMUNITY_INFO"
L_COMMUNITY_INFOView = os.path.join(FRIS_FGDB, "L_COMM_INFOView")
L_COMMUNITY_INFOTable = os.path.join(FRIS_FGDB, "L_COMM_INFO")
arcpy.TableToTable_conversion (L_COMMUNITY_INFO, FRIS_FGDB, "L_COMM_INFO")
arcpy.TruncateTable_management (L_COMMUNITY_INFOTable)
arcpy.MakeTableView_management (L_COMMUNITY_INFO, L_COMMUNITY_INFOView)
for ITEM in NewCIDList:
&amp;nbsp;&amp;nbsp;&amp;nbsp; CLAUSE = ("{0} = '{1}'".format ("CID", ITEM))
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByAttribute_management (L_COMMUNITY_INFOView, "NEW_SELECTION", CLAUSE)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Append_management (L_COMMUNITY_INFOView, L_COMMUNITY_INFOTable)
arcpy.Delete_management (L_COMMUNITY_INFOView, "")
del L_COMMUNITY_INFOTable&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The delete code looks like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# Delete Files
Delete_Shapes = []
for shapefile in os.listdir(OUTPATH):
&amp;nbsp;&amp;nbsp;&amp;nbsp; if fnmatch.fnmatch(shapefile, '*.shp'):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Delete_Shapes.append(shapefile)
&amp;nbsp;&amp;nbsp;&amp;nbsp; elif fnmatch.fnmatch(shapefile, '*.gdb'):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Delete_Shapes.append(shapefile)
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass

del shapefile

for shapefile in Delete_Shapes:
&amp;nbsp;&amp;nbsp;&amp;nbsp; get_file = os.path.join(OUTPATH, shapefile)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage("Deleting " + shapefile)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Delete_management(get_file)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The error occurs every time with the new code and never without.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I use Unlocker.exe to unlock and delete the folder so that I can start all over again, I am told that RuntimeLocalServer.exe is the process locking the database.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What is wrong with the new bit of code that causes the RuntimeLocalServer lock? And how do I fix it?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:33:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511481#M40160</guid>
      <dc:creator>JohnLay</dc:creator>
      <dc:date>2021-12-12T16:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot delete... May be locked by another application.</title>
      <link>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511482#M40161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Are you deleting the cursor somewhere...&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
S_POL_ARTable = arcpy.SearchCursor(S_POL_AR)
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Something like this :&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
if S_POL_ARTable:
&amp;nbsp;&amp;nbsp;&amp;nbsp; del S_POL_ARTable
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Good luck,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Neil&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:22:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511482#M40161</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2021-12-11T22:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot delete... May be locked by another application.</title>
      <link>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511483#M40162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, that was the first thing I tried. I haven't been able to find anything that will release the database programmatically. There are no .LOCK files in the database, yet arc seems to think that it is still in use.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can't even delete the database in Catalog outside of the script. I have to exit completely first.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Apr 2014 09:37:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511483#M40162</guid>
      <dc:creator>JohnLay</dc:creator>
      <dc:date>2014-04-22T09:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot delete... May be locked by another application.</title>
      <link>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511484#M40163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Edit: Looking at your error message, it says you are trying to delete the whole .gdb --- is that what you want to do? In any case, the code you posted has nothing to do with the error you are recieving and it is very difficult to determine your issue.&amp;nbsp; You may have to post the appropriate offending code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Cannot delete C:\~Working\FRIS\Test2\Alamance\NCFlood_Prelim_Alamance_GDB.gdb."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe try setting the overwriteOutput environment to True?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
arcpy.env.overwriteOutput = True
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//018z0000004s000000" rel="nofollow noopener noreferrer" target="_blank"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//018z0000004s000000&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:23:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511484#M40163</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2021-12-11T22:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot delete... May be locked by another application.</title>
      <link>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511485#M40164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks James, I'll try env.overwrite. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In answer to your other question, yes, I'm trying to delete the entire database after it has been zipped. We zip the data so that they are easily deliverable to FEMA, engineers, public, etc. After they are zipped, I don't need the database or shapes anymore because the master statewide files are stored in SDE--the the script exports FIRM data by county. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I didn't think that bit of code should have anything to do with the delete error either. Which is precisely why I've been scratching head for the last two days. It's just weird. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Nonetheless, when i strip the script of that bit of code, the files zip and then get deleted without issue. &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;With the code&lt;/SPAN&gt;&lt;SPAN&gt;, the geodatabase is locked by RuntimeLocalServer.exe.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Apr 2014 12:19:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511485#M40164</guid>
      <dc:creator>JohnLay</dc:creator>
      <dc:date>2014-04-22T12:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot delete... May be locked by another application.</title>
      <link>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511486#M40165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yeah... arcpy.env.overwriteOutput = True didn't work either.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Apr 2014 12:53:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511486#M40165</guid>
      <dc:creator>JohnLay</dc:creator>
      <dc:date>2014-04-22T12:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot delete... May be locked by another application.</title>
      <link>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511487#M40166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thanks James, I'll try env.overwrite. &lt;BR /&gt;&lt;BR /&gt;In answer to your other question, yes, I'm trying to delete the entire database after it has been zipped. We zip the data so that they are easily deliverable to FEMA, engineers, public, etc. After they are zipped, I don't need the database or shapes anymore because the master statewide files are stored in SDE--the the script exports FIRM data by county. &lt;BR /&gt;&lt;BR /&gt;I didn't think that bit of code should have anything to do with the delete error either. Which is precisely why I've been scratching head for the last two days. It's just weird. &lt;BR /&gt;&lt;BR /&gt;Nonetheless, when i strip the script of that bit of code, the files zip and then get deleted without issue. &lt;SPAN style="font-style:italic;"&gt;With the code&lt;/SPAN&gt;, the geodatabase is locked by RuntimeLocalServer.exe.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;overwriteOutput wouldn't make any difference in this case (I was confused because the code you posted is attempting to delete Feature Classes, NOT deleting the .gdb).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Where is the code for deleting the .gdb?&amp;nbsp; You never posted it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Apr 2014 13:00:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511487#M40166</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2014-04-22T13:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot delete... May be locked by another application.</title>
      <link>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511488#M40167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;the delete database is part of the same process. The bit of code that deletes makes a list (Delete_Shapes) of all the *.shp and *.gdb in the directory. Then, it runs through the list using a for loop and deletes each object.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# Delete Files
Delete_Shapes = []
for shapefile in os.listdir(OUTPATH):
&amp;nbsp;&amp;nbsp;&amp;nbsp; if fnmatch.fnmatch(shapefile, '*.shp'):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Delete_Shapes.append(shapefile)
&amp;nbsp;&amp;nbsp;&amp;nbsp; elif fnmatch.fnmatch(shapefile, '*.gdb'):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Delete_Shapes.append(shapefile)
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass

del shapefile

for shapefile in Delete_Shapes:
&amp;nbsp;&amp;nbsp;&amp;nbsp; get_file = os.path.join(OUTPATH, shapefile)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage("Deleting " + shapefile)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Delete_management(get_file)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the code above, OUTPATH is the root directory, not the database itself.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:23:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511488#M40167</guid>
      <dc:creator>JohnLay</dc:creator>
      <dc:date>2021-12-11T22:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot delete... May be locked by another application.</title>
      <link>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511489#M40168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I see what you mean -- are you dynamically creating this .gdb?&amp;nbsp; Try setting your ScratchWorkspace to the folder that contains the .gdb you want to delete.&amp;nbsp;&amp;nbsp; This works for me:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;


ws = r'H:\Documents\ArcGIS'
arcpy.env.workspace = ws
arcpy.env.scratchWorkspace = ws

items = arcpy.ListFiles('*.gdb')
for item in items:
&amp;nbsp;&amp;nbsp; if item == 'test.gdb':
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Delete_management(item)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "deleted" + str(item)

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:23:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511489#M40168</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2021-12-11T22:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot delete... May be locked by another application.</title>
      <link>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511490#M40169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That doesn't release the database either. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Argh! this is completely frustrating! &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I guess ultimately it doesn't really matter. I've inserted a try statement before the delete code (which is the very last process) to bypass the error and complete the script. The zips are created, which is really all I need. I can manually delete the garbage. I just wish I knew what was causing the issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Like I said previously, leaving the S_POL_ARTable searchcursor business out COMPLETELY resolves the problem. I just I could figure out what it was about that section of code that causes the issue.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Apr 2014 14:51:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511490#M40169</guid>
      <dc:creator>JohnLay</dc:creator>
      <dc:date>2014-04-22T14:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot delete... May be locked by another application.</title>
      <link>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511491#M40170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did anyone find a solution for how to delete locked shp files, I have same problem.. and very very frustrating...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Nov 2014 07:28:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511491#M40170</guid>
      <dc:creator>NaimeCelik</dc:creator>
      <dc:date>2014-11-14T07:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot delete... May be locked by another application.</title>
      <link>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511492#M40171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems you are using the older/original search cursor instead of the newer data access (da) search cursor.&amp;nbsp; Have you tried using the da.SearchCursor with a Python with statement?&amp;nbsp; Does that change the result?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Nov 2014 02:02:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511492#M40171</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2014-11-15T02:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot delete... May be locked by another application.</title>
      <link>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511493#M40172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did anyone get an answer to this. I am having the same issue however I am not using a search cursor at all I am using a delete&amp;nbsp; feature.. it is deleting one feature (DB2) and then moving feature 1 DB1 to DB2 where the previous feature was deleted. I keep getting this error as well. it makes no sense. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2015 19:27:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511493#M40172</guid>
      <dc:creator>lelaharrington</dc:creator>
      <dc:date>2015-03-12T19:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot delete... May be locked by another application.</title>
      <link>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511494#M40173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To anyone looking for answer. Its a bug. See below&lt;/P&gt;&lt;H3 style="color: #222222; font-size: 15px; margin-top: 17px; font-family: 'Avenir LT W01 35 Light', Arial, Helvetica, sans-serif; font-weight: normal !important;"&gt;Synopsis&lt;/H3&gt;&lt;P style="margin-bottom: 10px; font-size: 14px; color: #4d4d4d; font-family: Arial, Helvetica, sans-serif;"&gt;The arcpy.Delete_management (sde connection) function fails with the error, "000601: Cannot delete sde connection. May be locked by another application," in ArcMap 10.2.1.&lt;/P&gt;&lt;H3 style="color: #222222; font-size: 15px; margin-top: 17px; font-family: 'Avenir LT W01 35 Light', Arial, Helvetica, sans-serif; font-weight: normal !important;"&gt;Additional Information&lt;/H3&gt;&lt;P style="margin-bottom: 10px; font-size: 14px; color: #4d4d4d; font-family: Arial, Helvetica, sans-serif;"&gt;N/A&lt;/P&gt;&lt;H3 style="color: #222222; font-size: 15px; margin-top: 17px; font-family: 'Avenir LT W01 35 Light', Arial, Helvetica, sans-serif; font-weight: normal !important;"&gt;Alternate Solution&lt;/H3&gt;&lt;P style="margin-bottom: 10px; font-size: 14px; color: #4d4d4d; font-family: Arial, Helvetica, sans-serif;"&gt;Use os.remove() instead&lt;/P&gt;&lt;P style="margin-bottom: 10px; font-size: 14px; color: #4d4d4d; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.esri.com/en/bugs/nimbus/TklNMTAxMjIw" title="http://support.esri.com/en/bugs/nimbus/TklNMTAxMjIw"&gt;NIM101220 - The arcpy.Delete_management (sde connection) funct..&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Apr 2016 14:28:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511494#M40173</guid>
      <dc:creator>SugihonoBudiman</dc:creator>
      <dc:date>2016-04-29T14:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot delete... May be locked by another application.</title>
      <link>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511495#M40174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is True.&lt;/P&gt;&lt;P&gt;I had to delete the .gdb where it was happening and recreate it to be able to solve the issue!&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jun 2019 20:58:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511495#M40174</guid>
      <dc:creator>AliNazari</dc:creator>
      <dc:date>2019-06-05T20:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot delete... May be locked by another application.</title>
      <link>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511496#M40175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No good. Any patch coming soon?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sugihono Budiman&lt;/P&gt;&lt;P&gt;Software Architect&lt;/P&gt;&lt;P&gt;• 917.873.5949&lt;/P&gt;&lt;P&gt;• sugihono.budiman@pcfcorp.com&lt;/P&gt;&lt;P&gt;Publishers Circulation Fulfillment, Inc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;www.pcfcorp.com&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2019 01:40:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cannot-delete-may-be-locked-by-another-application/m-p/511496#M40175</guid>
      <dc:creator>SugihonoBudiman</dc:creator>
      <dc:date>2019-06-06T01:40:32Z</dc:date>
    </item>
  </channel>
</rss>

