Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 1 of 1 total
Thread Cannot Lock the Database error with single user
Fri, Nov 25 2022 12:13 PMPermanent Link

Adam Brett

Orixa Systems

I have a Delphi Windows App using EDB which has multiple users on distributed databases, 1 user per database instance each on a separate PC, data is shared using EDB's replication capability.

When the App closes poorly (crashes, something weird happens) and the user re-starts, the error: "Cannot Lock the Database XXX for exclusive access" often occurs, and the App can't access the database.

Trying to connect to EDB Manager when the database in this state also results in the same error message.

The manual says that this should be due to "multiple users connecting with different Catalog Paths" ... but I can't see how that could be the case in this situation, as there is only 1 user and they are using a single set of connection details stored in the Registry.

The behaviour occurs when there are a large number of files in EDB's Temporary folder ... many of which cannot be deleted as they are marked as open / "in use" by some other program.

The issue is solved by closing down the PC and deleting all the files from the Temporary folder.

My guess is that poor shut-down has resulted in some "ghost locks" on the database.

Does anyone else see this type of behaviour and / or know how to deal with it?

--

Side note, when I run:

SELECT * FROM Configuration.ServerSessions

I sometimes see 1 disconnected session, but never more than this.

I have plenty of systems where dozens of users connect to 1 EDB database simultaneously, so I am not clear why this exclusive lock error is occurring, it only seems to start after one or more user has crashed out of their App.

I make very few "sensitive" (read-write) calls to the database, which might "lock up" the database, but I do have quite a lot of data returned from queries of the database-schema as I use this to build the App.
Image