1

I'm using a file-backed MapDB which I create like this:

File dbFile = new File("db");
DBMaker.newFileDB(dbFile)
    .closeOnJvmShutdown()
    .make();

I noticed that there are 3 files being created:

  1. db
  2. db.p
  3. db.t

I need a way store and retrieve a DB remotely. I need to use a single file (store a file / retrieve a file). Do I need all three files? I found that trying to recreate a DB from just the "main" file (db) throws an exception. Is there a way (some config option or something) I can tell MapDB to use only one file?

Thanks for your help

Bono
  • 4,757
  • 6
  • 48
  • 77
amitayh
  • 770
  • 1
  • 8
  • 19

1 Answers1

2

New MapDB 2 uses single file storage, so there is no .p file.

.t file is transaction log and should be deleted if db is closed correctly.

Jan Kotek
  • 1,084
  • 7
  • 4
  • 1
    It does seem to work - however, the file size is much bigger. A relatively empty DB gave me about 38KB in version 1, but the same DB in version 2 is 2MB! Do you know if there's something to do? I tried playing the the values of allocateStartSize / allocateIncrement, but it didn't help... :( – amitayh Aug 12 '15 at 17:18