You are here: > ESRI Forums > arcgis desktop discussion forums > Thread Replies

ArcGIS Desktop Discussion Forums

ArcGIS Desktop - Geodatabases forum

File Geodatabase Schema Lock - Python   Lucas Hutmacher Apr 05, 2007
Re: File Geodatabase Schema Lock - Python   Andrew Perencsik Apr 05, 2007
Re: File Geodatabase Schema Lock - Python   Lucas Hutmacher Apr 05, 2007
Re: File Geodatabase Schema Lock - Python   Michael Van Altena May 01, 2007
Re: File Geodatabase Schema Lock - Python   Andrew Perencsik May 01, 2007
Re: File Geodatabase Schema Lock - Python   Michael Van Altena May 01, 2007
Re: File Geodatabase Schema Lock - Python   Andrew Perencsik May 07, 2007
Re: File Geodatabase Schema Lock - Python   Michael Van Altena May 09, 2007
Re: File Geodatabase Schema Lock - Python   Paul Scipione Sep 26, 2008
Re: File Geodatabase Schema Lock - Python   Premkumar Balakrishnan Nov 20, 2008
Re: File Geodatabase Schema Lock - Python   Paul Scipione Nov 20, 2008
Re: File Geodatabase Schema Lock - Python   David Sousa Nov 21, 2008
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject File Geodatabase Schema Lock - Python 
Author Lucas Hutmacher 
Date Apr 05, 2007 
Message Good day,
I'm trying to convert one of my Models over to run through a File Geodatabase, however i keep getting schema locks on classes/objects that i'm trying to write over.

The LOCK files are present in the folder & when i try to compress/uncompress the FGDB, i get the following error message:

Saving of data file to File GDB has failed (Unspecified error; (code 80004005)

File: .\sources\GpSdcCompressFGDBDataFunction.cpp, line: 320)
File: .\sources\GpSdcCompressFGDBDataFunction.cpp, line: 325
Cannot acquire a schema lock because of an existing lock.
Failed to execute (CompressFileGeodatabaseData_2).


I cannot get these files to delete, be it manually or through ArcCatalog. I've tried:
- Compressing/uncompressing
- Deleting the feature class
- Renaming/Deleting the entire geodatabase

and all seem to be locked up. Is there any way to get this silly thing unlocked?

I'm pretty new to the File Geodatabase thing & have been setting up some of my processes in here to help manage overall filesize on nightly processes (.mdb files tend to get big over time), however these problems are convincing me to go back (leave well enough alone - you know?).

Thanks for any suggestions
- Lucas 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: File Geodatabase Schema Lock - Python 
Author Andrew Perencsik 
Date Apr 05, 2007 
Message Lucas,

Is there another process accessing the data? This is probably why the locks are sticking around.

For example if you have both ArcMap and ArcCatalog accessing the data at once, you won't be able to compress / uncompress the data. Close one of these apps and then try again. Also consider that Python may also be holding the lock, try quiting out of python and then starting it back up again.

If all else fails, close all apps and the locks should clear up, but this shouldn't be necessary.

Andrew Perencsik
ESRI 
  Andrew Perencsik
ESRI 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: File Geodatabase Schema Lock - Python 
Author Lucas Hutmacher 
Date Apr 05, 2007 
Message This is the only process accessing the data. I've exited all apps & even rebooted, but the stuff is still locked.

I came in this morning and the script had hung up & i had to hard-kill it, which is probably why the locks weren't deleted automatically. 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: File Geodatabase Schema Lock - Python 
Author Michael Van Altena 
Date May 01, 2007 
Message I'm experiencing a similar issue where the .lock files remain - although I've been able to just delete them manually through Explorer.

I just finished deleting 1800 .lock files from a relatively small File Geodatabase with only ~20 layers. The .lock files never seem to disappear on their own... 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: File Geodatabase Schema Lock - Python 
Author Andrew Perencsik 
Date May 01, 2007 
Message Hi Michael,

Are you saying you have just one process accessing the data and locks previously put down are still getting in your way?

Are you sure there are no other processes holding the locks? Check your task manager to make sure the other processes have really stopped, also are there other users accessing the data over the network? You shouldn't have to manually delete the locks.

Andrew Perencsik
ESRI 
  Andrew Perencsik
ESRI 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: File Geodatabase Schema Lock - Python 
Author Michael Van Altena 
Date May 01, 2007 
Message The locks don't appear to actually get in my way (i.e. the fact that they are present have not affect my program or ArcGIS in any way), however the lock files never seem to be removed "automatically".

I get the same thing regardless if I'm using ArcCatalog, ArcMap or my ArcEngine Windows Form application.

E.g. I start with a clean boot and no .lock file in the File Geodatabase. I open ArcMap, add some layers into an new .mxd (thus creating .lock files for those layers). I then exit ArcMap and look in the File Geodatabase folder, and any .lock files that were generated remain - even though ArcMap has been closed and no other Arc-related processes are running.

P.S. I'm using ArcGIS 9.2 with SP2 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: File Geodatabase Schema Lock - Python 
Author Andrew Perencsik 
Date May 07, 2007 
Message Lock files can get left behind like this, but you should not be concerned about them as they are harmless.

ArcGIS attempts to clean up lock files whenever it can, however if there is any type of abnormal program termination or other problem, orphaned lock files can be left behind. But again, they are harmless, so the best thing to do is ignore them. The thing to think of is simultaneous processes accessing the same data, that is what can lock you out.

Andrew
ESRI 
  Andrew Perencsik
ESRI 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: File Geodatabase Schema Lock - Python 
Author Michael Van Altena 
Date May 09, 2007 
Message I suppose that's somewhat good news (that they won't affect things), although it greatly increases the number of files that are left lying around. At least I've only got one user connected at any time.

On a related note, I've also seen on some computers where it creates what looks to be a .lock file, although instead of a .lock extension it has a .xxxx extension where the xxxx are very funky characters (i.e. non-alpha - typically boxes and sometimes asian). It's the _gdb.xxxx and other layers, and all the files are 0 bytes in size (I've included an attachment screenshot of the file list).

I'm not sure if this is an indication of another problem?

Thanks,

Michael.
 
  FunkyFiles.PNG (opens in new window)
 
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: File Geodatabase Schema Lock - Python 
Author Paul Scipione 
Date Sep 26, 2008 
Message I have to say I am not too impressed with Geoprocessing in ArcGIS 9.3. The wierd error messages that tell me nothing helpful for resolution. Ok, I have tried this in ArcCatalog with just the Geoprocessing tool and in a CMD window executing a Python script that calls the TableToDomain gp tool, and all this after rebooting my PC, and making sure the are no .lock files in the File GDB folder. It doesn't work! I keep getting that stupid schema lock error, even though ther are no apps accesing the File GDB and I am executing this via a Python script in a CMD window. What gives? Maybe it would be smart if ESRI told you the PID of what was "locking" the schema. I think this is a serious bug! Oh I especially like the 999999 error code, thats special. 
  Paul J. Scipione
GIS Database Administrator
APS
602-371-7091
paul.scipione@aps.com 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: File Geodatabase Schema Lock - Python 
Author Premkumar Balakrishnan 
Date Nov 20, 2008 
Message The message will also appear if the database is locked by a service that you might have created and is running. You might want to STOP the service and then try compacting the database.

NB: Original poster might have overcome his problem. The response is for the thread visitors.

 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: File Geodatabase Schema Lock - Python 
Author Paul Scipione 
Date Nov 20, 2008 
Message Premkumar,

I have/had not services running that would've been accesing and file gdb. As my post stated I rebooted my PC, then went straight to a CMD window and executed the TableToDomain gp tool through a Python script, so no ESRI software or any other service was accessing the File GDB. So if the ESRI software is saying there is a schema lock, it should be able to say what process or service is locking the schema, not a 999999 error code. That's totally useless. 
  Paul J. Scipione
GIS Database Administrator
APS
602-371-7091
paul.scipione@aps.com 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: File Geodatabase Schema Lock - Python 
Author David Sousa 
Date Nov 21, 2008 
Message The format of the FileGDB schema lock error messages has been enhanced in 9.3 SP1. It now shows a great deal of additional information that should help you track down what is happening on your system and/or file system network.

-David Sousa