{
// Start clean
cache.getInvocationContext().reset();
tm.begin();
TransactionTable tt = cache.getTransactionTable();
cache.getRoot().put("key", "value");
assertNotNull("Tx should have been set up by now", cache.getInvocationContext().getTransaction());
assertEquals("The same current transaction should be associated with this invocation ctx.", tm.getTransaction(), cache.getInvocationContext().getTransaction());
assertNotNull("Gtx should have been set up by now", cache.getInvocationContext().getGlobalTransaction());
Transaction tx = tm.getTransaction();
TransactionContext transactionContext = tt.get(tt.get(tx));
if (commit)
{
tm.commit();
}