Problem with closing database

1729
4
01-25-2012 02:49 AM
ArturRedzko
New Contributor
I made a C wrapper dll to expose simple API for using SDK 1.1 and noticed that opening more than one layer from the same database ( .gdb using client app) causes hanging upon CloseGeodatabase execute.  If there is only one layer opened, it can be closed without any problems. My question is do I have to share the same "connection to database" for different clients using dll to open any layer or can I open database for each request and return new handle?

Regards
Artur
0 Kudos
4 Replies
LanceShipman
Esri Regular Contributor
Are you closing the tables before attempting to close the geodatabase?
0 Kudos
ArturRedzko
New Contributor
Yes. I'm closing and clearing all resources and handles taken from database. The problem occurs even if I do the simplest scenario:

- initialize dll for one client
- open a database test.gdb
- initialize dll for second client
- open the same database test.gdb
- try to close a database for first client

It's enough to hang the app (inside dll) on CloseGeodatabase. I noticed that inside the test.gdb directory a lock file is begin created. Sometimes after a long time of waiting the databases close. But in most cases I must kill the app. I tried to repeat the same situation using a simple console app that is using the same code as my dll bypassing the C wrapper and it works fine. I can create multiple access to the same database and close them without problems. So it looks like a dll issue.
0 Kudos
LanceShipman
Esri Regular Contributor
Can you post your code. We have C++ tests for this and have seen no problems.
0 Kudos
ArturRedzko
New Contributor
Problem solved. I found this in your readme.txt :

KNOWN ISSUES:

* Concurrent access from Windows and Linux clients to the same File GeoDatabase can corrupt data. This combination should be avoided.

so I made a shared connection for the same database and it works fine now.

Hope to see new update 1.2 with working spatial index soon.

Regards
Artur
0 Kudos