Package javax.transaction

Examples of javax.transaction.TransactionManager.suspend()


         // start the 1st tx
         mgr.begin();
         tx = mgr.getTransaction();
         assertEquals(value, cache.get(fqn, key));
         mgr.suspend();

         // start a new tx
         mgr.begin();
         assertEquals(value, cache.get(fqn, key));
         mgr.commit();
View Full Code Here


         {
            monitor.wait(500);
         }
      }

      tm.suspend();

      // Confirm that B's tx replicated
      assertTrue(cacheA.peek(Fqn.fromString("/EXISTS"), false, false) != null);

      cacheB.stop();
View Full Code Here

      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
      assertNull(cache.get(fqn, key));
      assertNull(loader.get(fqn));
View Full Code Here

      cache1.getConfiguration().setSyncCommitPhase(true);
      cache2.getConfiguration().setSyncCommitPhase(true);

      TransactionManager mgr = beginTransaction();
      cache1.put("/a/b/c", "age", 38);
      tx = mgr.suspend();
      assertNull("age on cache2 must be null as the TX has not yet been committed", cache2.get("/a/b/c", "age"));
      log.debug("cache1: locks held before commit: " + CachePrinter.printCacheLockingInfo(cache1));
      log.debug("cache2: locks held before commit: " + CachePrinter.printCacheLockingInfo(cache2));
      mgr.resume(tx);
      mgr.commit();
View Full Code Here

      System.out.println("cache1 (before commit):\n" + CachePrinter.printCacheLockingInfo(cache1));
      System.out.println("cache2 (before commit):\n" + CachePrinter.printCacheLockingInfo(cache2));

      // instead of a listener lets just get a WL on ROOT on cache2. And hold on to it.
      Transaction tx = tm.suspend();

      tm.begin();
      cache2.getRoot().put("x", "y");
      Transaction tx2 = cache2.getTransactionManager().suspend();
View Full Code Here

                     log.tracef("Rolling back remotely originated tx %s", command.getGlobalTransaction());
                     tm.rollback();
                  }
               } else { // Wait for a remote commit/rollback.
                  remote2localTx.put(command.getGlobalTransaction(), localTx.getGlobalTransaction());
                  tm.suspend();
               }
            }
         }
      }
View Full Code Here

      boolean ok;

      Transaction toResume = null;
      try
      {
         toResume = tm.suspend();

         ok = setupJMSObjects();
      }
      finally
      {
View Full Code Here

      Transaction tx = tm.getTransaction();

      // Remove the association between current thread - we don't want it
      // we will be committing /rolling back directly on the transaction object

      tm.suspend();

      if (JMSBridgeImpl.trace)
      {
         HornetQJMSServerLogger.LOGGER.trace("Started JTA transaction");
      }
View Full Code Here

      cache.put(AB, "k", "v");

      tm.begin();
      assert cache.getNode(AB) != null;
      Transaction reader = tm.suspend();

      tm.begin();
      cache.evict(AB);
      assert cache.getNode(AB) == null;
      tm.commit();
View Full Code Here

      assert cache.getNode(AB) == null;

      tm.begin();
      assert cache.getNode(AB) == null;
      Transaction reader = tm.suspend();

      tm.begin();
      cache.put(AB, "k", "v");
      assert cache.getNode(AB) != null;
      assert "v".equals(cache.get(AB, "k"));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.