@Override
    public long getEntryCount() {
        return lmdbEnvironment.getWithReadTxn(this::getEntryCount);
    }
This will fail if you are already inside a txn.
stroom-lmdb/src/main/java/stroom/lmdb/AbstractLmdbDb.java