jankotek / mapdb

MapDB provides concurrent Maps, Sets and Queues backed by disk storage or off-heap-memory. It is a fast and easy to use embedded Java database engine.
https://mapdb.org
Apache License 2.0
4.87k stars 873 forks source link

Is DB thread-safe? #1023

Open hlms opened 11 months ago

hlms commented 11 months ago

Hello team,

I'm passing a same DB object to multiple threads, and they all will invoke commit() methods. I hope DB object is thread-safe. Please correct me if that is NOT the case.

DB db = DBMaker.fileDB("file.db")
            .checksumHeaderBypass()
            .transactionEnable()
            .closeOnJvmShutdown()
            .make();