public <R> R readResult(final Function<ReadTxn, R> function) {
        try (final ReadTxn txn = new ReadTxn(env, errorHandler)) {
            return function.apply(txn);
        } catch (final RuntimeException e) {
            errorHandler.error(e);
            throw e;
        }
    }
Synchronise writes to ensure only a single thread can write.

@param consumer Consumer for the write transaction.
stroom-lmdb/src/main/java/stroom/lmdb2/LmdbEnv.java