Problem solving: Clearing / Removing Temporary Files created by the database, AKA: What to do if your App fails to open with a "Cannot lock database" Error
The Orixa Database is very robust and reliable, but in certain circumstances such as unplanned shut down temporary files used by the database may not be deleted. If large numbers of these files build up Orixa can have problems trying to start a new instance of your App.
An error will show "Cannot lock the database for shared access". If you simply try to start your App again it will usually open. But the temporary files will persist and continue to cause this issue. To resolve the issue they should be deleted.
If the issue recurrs it may be sensible to program a procedure into your App to automate the removal of these files.
NOTE: You cannot do any damage to your system by trying to delete these files. If a file is in use you will see a "cannot delete" message, and you will have to leave this file. It can be deleted later, for example after you have restarted your system, or after enough time has passed to allow the file to become unlocked.
Also the presence of these files is perfectly normal. In a large system each user can create hundreds of Temp-files, so it is normal for this folder to contain hundreds or thousands of temp files.
What to do if your Orixa App shows "Cannot lock the database" error on Start-up
Error: Cannot lock the database Data for shared access |
To fix this problem usually all that is needed is to delete some or all of the temporary files created by your App.
|
How to delete temporary files created by your App
It is best to restart your computer prior to this step, restarting will "unlock" any Temp files which are still being held by a database process. Restarting may also cause some of the excess files to be deleted by the database itself as it shuts down.
Locating the "Temp" folder for your App Database |
Find the folder which contains the files
To find the location of the Temp folder check in EDB Server: EDB Server Temp Folder Location |
Temp Files |
The Temp folder will usually show a long list of files with file extensions ".EDBBlb", "EDBIdx" and other similar names. If the database is running these files may well to active and in-use by your Orixa App. Click on one of these files and press [CONTROL] + A. This will select all the files in the folder. Now press Delete to start the deletion process. It is often sensible to remove disconnected or expired sessions before undertaking the next step. In this case, review actions in the following link: Solving the "Cannot lock Table XXX" Error message
|
Deleting Temporary Files, "File in Use" Message |
If a file is still locked, either by an active session of the database, or by a "hanging" lock from a session which is actually shut down, the "File In Use" message will show, as in the image on the left.
It should be possible to delete these files later, for example after a full system restart.
|
Usually once the temporary files are wholly or partially deleted your App should start without issues.
The "Cannot lock database" error is not a critical error indicating a big problem, it results from your computer having problems processing the large numbers of files in the Temporary Files folder if a large number have built up over time.