public void testNested()
throws Exception {
assertNull(currentTxn.getTxn());
DbTxn txn1 = currentTxn.beginTxn();
assertNotNull(txn1);
assertTrue(txn1 == currentTxn.getTxn());
assertNull(map.get(ONE));
assertNull(map.put(ONE, ONE));
assertEquals(ONE, map.get(ONE));
DbTxn txn2 = currentTxn.beginTxn();
assertNotNull(txn2);
assertTrue(txn2 == currentTxn.getTxn());
assertTrue(txn1 != txn2);
assertNull(map.put(TWO, TWO));
assertEquals(TWO, map.get(TWO));
DbTxn txn3 = currentTxn.beginTxn();
assertNotNull(txn3);
assertTrue(txn3 == currentTxn.getTxn());
assertTrue(txn1 != txn2);
assertTrue(txn1 != txn3);
assertTrue(txn2 != txn3);
assertNull(map.put(THREE, THREE));
assertEquals(THREE, map.get(THREE));
DbTxn txn = currentTxn.abortTxn();
assertTrue(txn == txn2);
assertTrue(txn == currentTxn.getTxn());
assertNull(map.get(THREE));
assertEquals(TWO, map.get(TWO));