I'm from time to time receiving NPEs once I enable deferredWrites for our database handle.
Caused by: java.lang.NullPointerException
Without deferredWrites it's never occuring. We are using a second database for a simple persistent transaction log which is cleared once changes are commit (for a file-backend despite our Java BerkeleyDB-binding). I think it's much better to use deferredWrites for this kind of operation, especially for the first initial import (in our case revision).
We are using version 5.0.34 as it somehow cannot find the new version in maven (maybe it's not yet in the official repo?). Maybe it's related to the bug in 11) meantioned in the changelog from 5.0.48.
BTW: Is it possible to get the size of a database easily? I'm using a StoredMap in another application, whereas the BerkeleyDB is some kind of an overflow protection if the RAM is full and I'm simple deciding based on a threshold size if the StoredMap instead of a "normal" Map (HashMap or something) must be used.
Edited by: 918519 on Jun 3, 2012 6:46 PM
Edited by: 918519 on Jun 3, 2012 6:51 PM
This was fixed in 5.0.48. If you search the change log for [#21015] you'll see it.
I'll check on the Maven issue but for the moment you may want to just download the release package and copy the JE jar.
JE does not maintain the database size but has a relatively low cost method for getting it (although it must enumerate all keys): Database.count.
We tested (thanks Yang) last night to be sure that the Maven site works for downloading JE 5.0.48. It works, so you may want to try again.
For example, this works: