fusesource / leveldbjni

A Java Native Interface to LevelDB
BSD 3-Clause "New" or "Revised" License
535 stars 145 forks source link

Is it support one process to read/write but the other process to only read? #92

Open Mxxim opened 7 years ago

Mxxim commented 7 years ago

Is it support one process to read/write but the other process to only read?

DB db = factory.open(new File("/Users/sammy/Workspace/node1/build/leveldb8001"), options);

When I do it(while the other process is opening the database to read/write), there is an error like this:

org.fusesource.leveldbjni.internal.NativeDB$DBException: IO error: lock /Users/sammy/Workspace/node1/build/leveldb8001/LOCK: Resource temporarily unavailable

If leveldb may only be opened by one process at a time, how can I make the other process read it?

Thanks for your attention!!