Berkeley DB error: The je.lck file could not be locked
Asked Answered
A

2

8

We are encountering the ff error when running a java program using a berkeley DB.

"The environment cannot be locked for single writer access. ENV_LOCKED: The je.lck file could not be locked. Environment is invalid and must be closed."

Any idea what is the cause of the error and how can we fixed this.

Thanks!

Alcus answered 23/12, 2011 at 5:46 Comment(0)
K
6

Your Berkeley DB is set up for "single writer access". You must have another process already writing to it and effectively locking it.

You should terminate the other process or processes and proceed. No idea if BerkeleyDB can be set up for multiple writer access, sorry.

PS - je.lck is a file in the file system that implements the lock. Deleting it might also free the DB for your process to access and revoke the other process' access.

Kakemono answered 11/12, 2012 at 17:1 Comment(2)
Is it mandatory to restart the new process after deleting the lock files?Carothers
@Carothers it's been too long since I've last used Berkeley DB for me to know but the error message does imply that a restart is mandatory. I can suggest that you experiment by running 2 processes, deleting the je.lck file when one errors and then check if it has recovered. Good luck.Kakemono
I
0

In my case problem occurs when app terminates and Environment not properly closed. You need to close it.

To solve opening problem you need to delete *.lck files in your db

Impatient answered 6/6, 2014 at 7:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.