SnappyDB
SnappyDB copied to clipboard
Failed to open/create database: IO error: lock
Hi,
I'm facing some concurrency issue whereby my threads are accessing the dB concurrently. Is there a snapshot created everytime the dB is opened?
com.snappydb.SnappydbException: Failed to open/create database: IO error: lock LOCK: already held by process
Hi @winsonlim
usually the thread that opens the database will lock it. you can not open it again from another Thread until you close it. but nothing prevent you from sharing the same DB instance across multiple threads (or through a Singleton)
It'd be cool, if you can share some code that reproduce this though, I'll take a look
Cheers
This just bit me. I am trying to open the DB in another process for reading. I don't need to write or anything, just read some stuff that is being written in the main process. Is there a workaround?
How performant is the open close process? I'd like to open when needed and close when done so I can use in my service process. I perform a lot of operations especially read, would this be impact performance?
I met the same problem ~I am trying to open the DB in another process for reading. I don't need to write or anything, just read some stuff that is being written in the main process~
Failed to open/create database: IO error lock LOCK:
@frostymarvelous what was your resolve on this issue?
I moved my service code into the same process.