mj527
mj527

Reputation: 161

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

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!

Upvotes: 8

Views: 6824

Answers (2)

urig
urig

Reputation: 16831

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.

Upvotes: 6

shurik2533
shurik2533

Reputation: 1780

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

Upvotes: 0

Related Questions