}
public void testPessimisticTransactionalWithCacheLoader() throws Exception
{
Fqn fqn = Fqn.fromString("/a/b");
TransactionManager mgr = cache1.getTransactionManager();
assertNull("Should be null", cache1.get(fqn, "key"));
assertNull("Should be null", cache2.get(fqn, "key"));
mgr.begin();
cache1.put(fqn, "key", "value");
assertEquals("value", cache1.get(fqn, "key"));
mgr.commit();
assertEquals("value", cache2.get(fqn, "key"));
assertEquals("value", cache1.get(fqn, "key"));
mgr.begin();
cache1.put(fqn, "key2", "value2");
assertEquals("value2", cache1.get(fqn, "key2"));
mgr.rollback();
assertEquals("value", cache2.get(fqn, "key"));
assertEquals("value", cache1.get(fqn, "key"));
assertNull("Should be null", cache1.get(fqn, "key2"));
assertNull("Should be null", cache2.get(fqn, "key2"));
}