public void putAll(final Map<K, V> entries) {
        lmdbEnvironment.doWithWriteTxn(writeTxn -> {
            try {
                entries.forEach((key, value) -> {
                    try (final PooledByteBuffer pooledKeyBuffer = getPooledKeyBuffer();
                            final PooledByteBuffer pooledValueBuffer = getPooledValueBuffer()) {

                        final ByteBuffer keyBuffer = pooledKeyBuffer.getByteBuffer();
                        final ByteBuffer valueBuffer = pooledValueBuffer.getByteBuffer();
                        serializeKey(keyBuffer, key);
                        serializeValue(valueBuffer, value);

                        lmdbDbi.put(writeTxn, keyBuffer, valueBuffer);
                    } catch (Exception e) {
                        throw new RuntimeException(LogUtil.message("Error putting key {}, value {}", key, value), e);
                    }
                });
            } catch (RuntimeException e) {
                throw new RuntimeException(LogUtil.message("Error putting {} entries", entries.size()), e);
            }
        });
    }
This will fail if you are already inside a txn.
stroom-lmdb/src/main/java/stroom/lmdb/AbstractLmdbDb.java