Hi,
With MapDB, Is it possible to reuse (write/search) the existing file db created from DBMaker.newFileDB(file) after the JVM dies to map it to new JVM's new DB and reuse that ?
Example :
If i had created a set and MapDB like
DB db = DBMaker.newFileDB(new File("c:/tmp/test.db")).cacheDisable().transactionDisable().mmapFileEnable()
.closeOnJvmShutdown().freeSpaceReclaimQ(10).make();
Set<String> set = db.createHashSet("set1").expireAfterWrite(100, TimeUnit.HOURS).make();
And I had put 1_000 records in set using set.add(String s). Then the JVM dies but file is not deleted from the disk.
so next time when i start,
DB db = DBMaker.newFileDB(new File("c:/tmp/test.db")).cacheDisable().transactionDisable().mmapFileEnable()
.closeOnJvmShutdown().freeSpaceReclaimQ(10).make();
Set<String> set = db.createHashSet("set1").expireAfterWrite(100, TimeUnit.HOURS).make();
I expect to be able to get all 1_000 records accessed from set created here.
But, when i run the test like that, i get 0 for set.size() and when i search for the record that i put in before the JVM died, i don't get that record in the set after JVM restart.
Is there any way to recover that test.db file that was created by another process ? and anyway to access the records through new set as explained in above example ?
Thanks,
Bhavin