Knowledge Base - Technical Articles


Technical Article   FAQ:  Why do file geodatabase .lock files remain after a process is finished?

Article ID: 33018
Software:  ArcGIS - ArcEditor 9.2, 9.3, 9.3.1, 10 ArcGIS - ArcInfo 9.2, 9.3, 9.3.1, 10 ArcGIS - ArcView 9.2, 9.3, 9.3.1, 10 ArcGIS Server 9.2, 9.3, 9.3.1, 10 ArcGIS Engine Developer Kit 9.2, 9.3 ArcGIS Engine Runtime 9.2, 9.3, 9.3.1, 10
Platforms:  Windows XP

Question

Why do file geodatabase .lock files remain after a process is finished?

Answer

The .lock files may remain in the file geodatabase directory after a crashed process, but they do not continue to hold their locks.

The .lock files can only be deleted if the process that created them has exited. A live lock cannot be deleted.
A lock does not survive rebooting. The .lock file may remain in the file geodatabase directory, but does not cause problems when a new lock is placed on the table.

To delete .lock files:

Use the Compact geoprocessing tool in ArcCatalog to remove .lock files. (In ArcToolbox under Data Management Tools > File Geodatabase > Compact.) This removes all inactive .lock files safely. The .lock files can also be deleted with Windows Explorer, the command line, or other file removal or deletion applications. Deleting any files other that the .lock files from the file geodatabase directory renders the database unusable and requires restoration from backup.

Created: 5/8/2007
Last Modified: 6/19/2012

Article Rating: (5)
If you would like to post a comment, please login

Comments

By josephk70 - 08/08/2013 1:57 PM

The article is incorrect or the solution didn’t work.

I wonder why the answer to the problem suggests using windows explorer to delete a locked file. Do they assume we don't understand how to delete a file? Obviously the problem is that .lock files are difficult to delete, particularly if your ArcGIS is on a network server. How about spending some of the money ESRI makes on this software on keeping it from crashing and causing .lock problems?

Rating:

By alexroma - 11/29/2011 5:31 PM

The article is incorrect or the solution didn’t work.

My FGDB is used by the ArcGIS Server (on a different IIS machine), and no matter how many times I stop the services that use this FGDB, the locks still won't go away, until I reboot the server that hosts the FGDB.

Rating:

By vpelleri - 10/26/2011 7:38 AM

The article needs to be updated.

Ending the AppROT.exe (Application Running Object Table) process removes any locks on my file geodatabase and allows me to write/delete as I need. I was running into the locking problem when running python or vb scripts that would crash on creating and/or deleting a feature class in the file geodatabase. Temporary tables would remain in the FGDB and I wouldn't be able to delete them even after rebooting. I assume that's because the AppROT.exe would open when I open ArcMap or ArcCatalog and keep an entry for the temporary table. As I said though, ending AppRot in the Task Manager frees up those items to be deleted.

By Anonymous - 05/27/2009 5:08 AM

The article is incorrect or the solution didn’t work.

That's not working... still lock file from a user how restart is workstation and lock file still there. and now i can't do nothing on that file gdb.

Rating:

By Anonymous - 09/09/2008 1:35 PM

The article is incorrect or the solution didn’t work.

I am having this issue, however, I reboot (hard) and the lock remains on the server I am working off of. After rebooting I try to compact the geodatabase through ArcCatalog and it fails with an error that says I have it opened exclusively and to try again when the database is available. I noticed this yesterday when working out of a geodatabase that I needed to create another feature class in and ArcCatalog would not let me even after closing ArcMap. Also, there have been no crashes prior to this happening.

Rating:

By Anonymous - 09/04/2008 2:49 AM

The article is incorrect or the solution didn’t work.

I disagree that Lock files are deleted. I have one stuck on one of my Personal Geodatabases. There was no crash. I've closed all Arc apllications down and rebooted the computer. I still can't remove the lock file! Unfortunately it is held on a server, I can't reboot that. My only option seems to be copy the database and start again.

Rating:

By Anonymous - 02/05/2008 11:44 AM

The article is incorrect or the solution didn’t work.

"A lock does not survive rebooting." this statement is erroneous in my experience. I've found lockfiles dating back many months in our fGDBs. Perhaps only lock files on local disks do not survive a reboot?