Package javax.transaction

Examples of javax.transaction.TransactionManager.resume()


      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


      // assert we can see this outside the existing tx
      assertEquals(pojo2, cache.get("/one/two", "key2"));
      System.out.println("Current TX " + mgr.getTransaction());
      // resume the suspended one
      mgr.resume(tx);
      System.out.println("Current TX " + mgr.getTransaction());
      // assert we can't see the change from tx2 as we already touched the node
      assertEquals(null, cache.get("/one/two", "key2"));
      mgr.commit();
      destroyCache(cache);
View Full Code Here

      // assert we can see this outsode the existing tx
      assertEquals(2, cache.getNode("/one/two").getKeys().size());

      // resume the suspended one
      mgr.resume(tx);
      // assert we can't see thge change from tx2 as we already touched the node
      assertEquals(1, cache.getNode("/one/two").getKeys().size());
      mgr.commit();
      destroyCache(cache);
View Full Code Here

      keys = cache.getNode("/one/two").getKeys();
      System.out.println("keys after TX #3 committed: " + keys);
      assertEquals(2, keys.size());

      // resume the suspended one
      mgr.resume(tx);
      // assert we can't see the change from tx2 as we already touched the node
      keys = cache.getNode("/one/two").getKeys();
      System.out.println("keys after TX #2 resumed (in private workspace of TX #2): " + keys);
      assertEquals(2, keys.size());// we will see key1 and key2, but *not* key3

 
View Full Code Here

      mgr.begin();
      assertNull(cache.get(fqn, key));
      mgr.commit();

      mgr.resume(tx);
      assertEquals(value, cache.get(fqn, key));
      mgr.commit();

      assertEquals(value, cache.get(fqn, key));
View Full Code Here

         // expected
         //cache.getTransactionManager().commit();
         tm.commit();
      }

      tm.resume(t);
      tx.rollback();

      assertNotNull(cache.getNode("/a/b/c"));
      assertEquals(0, cache.getNumberOfLocksHeld());
   }
View Full Code Here

      mgr.commit();

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

      mgr.resume(tx);

      // one-phase-commits wont throw an exception on failure.
      try
      {
         mgr.commit();
View Full Code Here

      TestingUtil.sleepThread((long) 1000);

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

      mgr.resume(tx);

      try
      {
         mgr.commit();
         assert false : "Expecting an exception";
View Full Code Here

      // should succeed...
      mgr1.commit();

      try
      {
         mgr2.resume(tx2);
         mgr2.commit();
         assertTrue("Should have failed", false);
      }
      catch (RollbackException rbe)
      {
View Full Code Here

      assertEquals(value + value, cache.get(abcd, key));
      assertEquals(value, cache.get(abce, key));
      assertEquals(value, cache.get(abcf, key));
      assertEquals(value, cache.get(abcg, key));

      tm.resume(tx);
      tm.commit();

      assertEquals(value, cache.get(abxy, key));

      NodeSPI<Object, Object> n = cache.getRoot();
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.