665666667668669670671672673674675
mgr.begin(); cache.put(fqn, key, value); assertEquals(value, cache.get(fqn, key)); tx = mgr.getTransaction(); mgr.suspend(); mgr.begin(); assertNull(cache.get(fqn, key)); mgr.commit();
122123124125126127128129130131132
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());
321322323324325326327328329330331
SamplePojo pojo = new SamplePojo(21, "test"); cache.put("/one/two", "key1", pojo); mgr.suspend(); assertEquals(1, cache.getTransactionTable().getNumGlobalTransactions()); assertEquals(1, cache.getTransactionTable().getNumLocalTransactions()); GlobalTransaction gtx = cache.getCurrentTransaction(tx, true);
102103104105106107108109110111112
tx1 = mgr1.suspend(); // start a tx on cache 2 mgr2.begin(); cache2.put(fqn, key, "value3"); tx2 = mgr2.suspend(); // which tx completes, which fail? mgr1.resume(tx1); // should succeed... mgr1.commit();
7475767778798081828384
tm.begin(); Transaction tx = tm.getTransaction(); cache.put(abxy, key, value); tm.suspend(); // a number of random puts in unrelated sub nodes. cache.put(abcd, key, value + value); cache.put(abce, key, value); cache.put(abcf, key, value);
979899100101102103104105106107
{ tm.begin(); print(cache.exists("/a/b/c")); print("get(): " + cache.get("/a/b/c", "test")); print("get(): " + cache.get("/a/b/c", "test")); Transaction t = tm.suspend(); try { cache.putForExternalRead(Fqn.fromString("/a/b/c"), "test", "test"); } catch (Exception ignore) {
2324252627282930313233
cache.put(AB, "k", "v"); tm.begin(); assert cache.getNode(AB) != null; Transaction reader = tm.suspend(); tm.begin(); assert cache.removeNode(AB); assert cache.getNode(AB) == null; tm.commit();
7879808182838485868788
// we are done with any tx propagation setup, let's move on return context.proceed(); } finally { // suspend the originating remote tx on this thread now that the invocation has been done if (originatingRemoteTx != null) { transactionManager.suspend(); } } } /**
99100101102103104105106107108109
// application class loader during the beforeDelivery call. previousClassLoader = doPrivileged(contextClassLoader(getApplicationClassLoader())); try { final TransactionManager tm = getTransactionManager(); // TODO: in violation of JCA 1.6 FR 13.5.9? previousTx = tm.suspend(); boolean isTransacted = service.isDeliveryTransacted(method); if (isTransacted) { tm.begin(); currentTx = tm.getTransaction(); if (xaRes != null)
340341342343344345346347348349350
boolean ok; Transaction toResume = null; try { toResume = tm.suspend(); ok = setupJMSObjects(); } finally {