Stanley Bradbury wrote:

Hi John -
When using a version 1.4.2 JVM or higher and the default Derby property set you should not need to manually remove the db.lck file.
Just to reiterate if your JVM is higher that 1.4.2 then none of the below applies. Unless there is a bug, Derby will only lock you out if an existing JVM still has a lock on that file. There should be no OS/JVM/machine variations if you have version 1.4.2 or higher and are
seeing this message.

Can you describe what it means that your program "crashed"?  Did the JVM
that was running it go down?  Are you using network server, if so is it
possible your client program crashed but left the network server up and
still connected to database?

The message
you are getting indicates that the db.lck file exists AND a process has the file locked. Generally when an embedded Derby application aborts the JVM aborts too thus releasing the filelock. The next time database access is attempted the db.lck is found but it is not locked so Derby removes the old file, creates a new one and boots the database. The property derby.database.forceDatabaseLock changes this behavior so unset this if it is set: [On some platforms, if set to true, prevents Derby from booting a database if a db.lck file is present in the database directory]. Otherwise check to see if, after the application crashes, there is still a JVM process running. If so need to either reattach to that process or kill the JVM process to get past the filelock or release it.

HTH




Reply via email to