public static DbTxn createTransaction(DbEnv environment) throws DbException {
// TODO remove dirty hack!
cachedEnvironment = environment;
CurrentTransaction currentTxn = CurrentTransaction.getInstance(environment);
return currentTxn.beginTxn();
/**
// TODO temporary hack until BDB supports nested transactions
if (getTransactionCount() == 0) {
DbTxn transaction = environment.txnBegin(getTransaction(), TRANSACTION_FLAGS);
pushTransaction(transaction);