// ctx.putLookedUpEntry(k, null);
DummyTransactionManager dtm = (DummyTransactionManager) tm();
tm().begin();
cache.put(k, "some");
final DummyTransaction transaction = dtm.getTransaction();
transaction.runPrepare();
tm().suspend();
// test that the key is indeed locked.
assertLocked(cache, k);
final CountDownLatch txStartedLatch = new CountDownLatch(1);
TxThread transactionThread = new TxThread(cache, txStartedLatch);
transactionThread.start();
txStartedLatch.countDown();
Thread.sleep(500); // in case the thread needs some time to get to the locking code
// now abort the tx.
transactionThread.tm.resume(transactionThread.tx);
transactionThread.tm.rollback();
// now release the lock
tm().resume(transaction);
transaction.runRollback();
transactionThread.join();
assertNotLocked(cache, k);
}