@Override
    public long getEntryCount(final Txn<ByteBuffer> txn) {
        return lmdbDbi.stat(txn).entries;
    }
This will fail if you are already inside a txn.
stroom-lmdb/src/main/java/stroom/lmdb/AbstractLmdbDb.java