I have problems to release my gdb in ArcGIS10. My tool works with an local gdb, but I failed to release it after the process. In Ag9.3 I can release it simply by Marshal.ReleaseComObject(workspace), but this doesn't work in AG10. Also releasing all FeatureCursors doesn't help. Only closing the whole application "deletes" the lock. Does anyone know how to release my gdb and "delete" the lock without closing the application?
|
|
Getting to this condition is easy - all you need is one object that is holding a reference to something that needs the workspace to stay alive. Like a custom object that holds a Feature for example. Once you are sure you hold no such references, try calling GC.collect() to force the garbage collector into a quasi-deterministic cleanup mode |
|||
|
|
|
I had a quick look and found information on the locking scenario you seem to be having. In ArcObjects 10 there is a SetWriteLock and FreeWriteLock option. have a look at the forum link specifically the sample from Lance Shipman from Esri http://forums.arcgis.com/threads/36881-the-performance-fgdb-api-amp-arcobjects Have Fun, CDB |
|||
|
|
|
If you are using cursors in your application make sure to use the ComReleaser to manage the lifetime of the cursors and destroy them when you are done with them. Otherwise they can lock your DBMS. I might be wrong but I don't thing calling ReleaseComObject on the workspace alone removes the reference to the cursors. Take a look at this ESRI blog post... |
||||
|
|
|
Found Idea from http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//003n0000007w000000 “These .lock files are removed whenever you run the geoprocessing Compact tool”
|
||||
|
|