Select to view content in your preferred language

File geodatabase lock files are not automatically deleted since ArcGIS Pro 3.5

96
3
Wednesday
ljlopez
Occasional Contributor

Hi all,

I have an ArcGIS Pro add-in that has been working on all 3.x versions of ArcGIS Pro but fails on 3.5. Its code creates a File Geodatabase, imports some feature classes, and then creates a zip file of the File Geodatabase. Since version 3.5, the creation of the zip file fails with the following error message:

The process cannot access the file {path_to_geodatabase}.gdb\a0000000d.gdbtable because it is being used by another process

The File Geodatabase and all its feature classes are successfully created, and the code uses using statements for the geodatabase, feature classes, insert cursors, etc., so that they are all properly disposed. Also, the code is called on the Main CIM Thread (MCT) using QueuedTask.Run().

I noticed that since 3.5 two lock files are kept inside the File Geodatabase folder, and they are not automatically deleted no matter how much time you wait. This did not happen with earlier versions of ArcGIS Pro.

Has a new behaviour regarding File Geodatabase locking or the MCT been introduced in 3.5? Is there a way to remove programmatically the lock files, or make sure that the process terminates appropriately using the ArcGIS Pro SDK for .NET?

0 Kudos
3 Replies
Aashis
by Esri Contributor
Esri Contributor

@ljlopez We haven't changed the behaviour for File Geodatabase. If possible, could you pls send your code? We'd love to investigate it. 

0 Kudos
Wolf
by Esri Regular Contributor
Esri Regular Contributor

I made a small sample add-in that imports a csv (included as add-in content) and adds the data into a new feature class in your project's default geodatabase.   To run the add-in start with a new [empty] map [template] and open the 'FGB Importer' tab.  Click the 'Show FGB Importer' button to open the Importer dockpane.  On the dockpane all paths etc. should be filled in.  Just click the 'Import into F/C' button.  This will create a new feature class in the given geodatabase and then adds the csv data to that feature class. 
Maybe i left out something in my code, but i also have the remaining .lock file in my geodatabase folder.  I am currently running 3.6 but i will try 3.4 tomorrow.
I will add this code to the community samples with the 3.6 release, it hasn't been fully debugged.

0 Kudos
Wolf
by Esri Regular Contributor
Esri Regular Contributor

I tried this Addin using ArcGIS Pro 3.4 and i see the .lock files in 3.4 as well.   As far as i can tell, the geodatabase connection must still be open.   I think the same happens when you use the Catalog dockpane and manually open the Geodatabase:  a .lock file is created and stays until you close Pro.  I don't see a change in behavior between 3.4 and 3.5.