Package javax.transaction

Examples of javax.transaction.TransactionManager.resume()


      {
         System.out.println("Transaction was rolled back, this is correct");
      }
      finally
      {
         tm.resume(tx2);
         tm.rollback();
      }

      // Sleep, as the commit call to cache2 is async
      TestingUtil.sleepThread(1000);
View Full Code Here


         LocalTransaction localTx = txTable.getLocalTransaction(localTxId);
         if (localTx == null) {
            throw new IllegalStateException("Local tx not found but present in the tx table!");
         }
         TransactionManager txManager = txManager();
         txManager.resume(localTx.getTransaction());
         if (commit) {
            txManager.commit();
         } else {
            txManager.rollback();
         }
View Full Code Here

      }
      finally
      {
         if (toResume != null)
         {
            tm.resume(toResume);
         }
      }

      if (ok)
      {
View Full Code Here

      assert cache.getNode(AB) == null;
      tm.commit();

      assert cache.getNode(AB) == null;

      tm.resume(reader);
      assert cache.getNode(AB) != null;
      assert "v".equals(cache.get(AB, "k"));
      tm.commit();

      assert cache.getNode(AB) == null;
View Full Code Here

      tm.commit();

      assert cache.getNode(AB) != null;
      assert "v".equals(cache.get(AB, "k"));

      tm.resume(reader);
      assert cache.getNode(AB) == null;
      assert cache.get(AB, "k") == null;
      tm.commit();

      assert cache.getNode(AB) != null;
View Full Code Here

      {
         mgr.begin();
         c.put("/a", "k", "v");
         Transaction t = mgr.suspend();
         c.put("/a", "k2", "v2");
         mgr.resume(t);
         mgr.commit();
         assertTrue("Expecting a rollback exception!", false);
      }
      catch (RollbackException re)
      {
View Full Code Here

      Transaction tx = mgr.suspend();

      // now remove the original node...
      c.removeNode(fqn);

      mgr.resume(tx);
      // now try and commit this - this should fail.
      boolean ok = false;
      try
      {
         mgr.commit();
View Full Code Here

      Transaction tx = mgr.suspend();

      // now change the original node...
      c.put(fqn, "key3", "value3");

      mgr.resume(tx);
      // now try and commit this - this should fail.
      boolean ok = false;
      try
      {
         mgr.commit();
View Full Code Here

      mgr.begin();
      cache.put("/b", "key", "value2");
      mgr.commit();

      mgr.resume(tx1);
      try
      {
         mgr.commit();
         assertTrue("Should have failed", false);
      }
View Full Code Here

      mgr.commit();

      assertEquals(1, cache.getTransactionTable().getNumGlobalTransactions());
      assertEquals(1, cache.getTransactionTable().getNumLocalTransactions());

      mgr.resume(tx);

      boolean fail = false;
      try
      {
         mgr.commit();
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.