102103104105106107108109110111112
Assert.assertNull(loader.get(fqn)); mgr.begin(); cache.put(fqn, key, value); tx = mgr.getTransaction(); mgr.suspend(); // lets see what we've got halfway within a tx Assert.assertNull(cache.get(fqn, key)); Assert.assertNull(loader.get(fqn));
240241242243244245246247248249250
cache.put("/one/two", "key1", pojo); assertEquals(pojo, cache.get("/one/two", "key1")); //suspend current transaction mgr.suspend(); //start a new transaction mgr.begin(); Transaction tx2 = mgr.getTransaction(); // inject InvocationContext
125126127128129130131132133134135
SamplePojo pojo = new SamplePojo(21, "test"); cache.put("/one/two", "key1", pojo); mgr.suspend(); assertEquals(1, cache.getTransactionTable().getNumGlobalTransactions()); assertEquals(1, cache.getTransactionTable().getNumLocalTransactions()); assertNull(mgr.getTransaction());