I would like to access (read & write) a Berkeley DB from multiple threads (all same process/jvm).
Should I use a single com.sleepycat.je.Database object for all threads, or should I create an instance for each?
Or is there any other way of doing it?
The Database object may be used by multiple threads, so you can use a single instance or multiple ones, as best suits you. From http://docs.oracle.com/cd/E17277_02/html/java/com/sleepycat/je/Database.html,
Database handles are free-threaded and may be used concurrently by multiple threads. '
If you read through the javadoc, you'll find other notes on using classes from multiple threads.