Package javax.transaction

Examples of javax.transaction.TransactionManager.resume()


      catch (RollbackException roll)
      {
         assertTrue("Ought to have succeeded!", false);
      }

      mgr2.resume(tx2);
      try
      {
         mgr2.commit();
         assertTrue("Ought to have succeeded!", true);
      }
View Full Code Here


      cache1.getNotifier().addCacheListener(lis);
      lis.put("/a/b/c", "age", 38);

      tm.suspend();
      assertNull("age on cache2 must be null as the TX has not yet been committed", cache2.get("/a/b/c", "age"));
      tm.resume(tx);
      tm.commit();

      // value on cache2 must be 38
      age = (Integer) cache2.get("/a/b/c", "age");
      assertNotNull("\"age\" obtained from cache2 must be non-null ", age);
View Full Code Here

      map.put("age", 38);
      map.put("name", "Ben");
      lis.put("/a/b/c", map);
      tm.suspend();
      assertNull("age on cache2 must be null as the TX has not yet been committed", cache2.get("/a/b/c", "age"));
      tm.resume(tx);
      tm.commit();

      // value on cache2 must be 38
      age = (Integer) cache2.get("/a/b/c", "age");
      assertNotNull("\"age\" obtained from cache2 must be non-null ", age);
View Full Code Here

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

      mgr.resume(tx);
      assertNull(cache.getNode(fqn));
      mgr.commit();

      assertNull(cache.getNode(fqn));
   }
View Full Code Here

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

      mgr.resume(tx);
      assertNull(cache.getNode(fqn));
      mgr.commit();

      assertNull(cache.getNode(fqn));
   }
View Full Code Here

      {
         public void run()
         {
            try
            {
               tm.resume(tx);
               tm.commit();
            }
            catch (Exception e)
            {
            }
View Full Code Here

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

         mgr.resume(tx);
         assertEquals(value, cache.get(fqn, key));
         mgr.commit();
      }
      finally
      {
View Full Code Here

      // lets see what we've got halfway within a tx
      assertNull(cache.get(fqn, key));
      assertNull(loader.get(fqn));

      mgr.resume(tx);
      mgr.commit();

      // and after committing...
      assertEquals(value, cache.get(fqn, key));
      assertEquals(value, loader.get(fqn).get(key));
View Full Code Here

      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();
      log.debug("cache1: locks held after commit: " + CachePrinter.printCacheLockingInfo(cache1));
      log.debug("cache2: locks held after commit: " + CachePrinter.printCacheLockingInfo(cache2));

      // value on cache2 must be 38
View Full Code Here

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

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

      try
      {
         tm.commit();
         fail("commit should throw a RollbackException, we should not get here");
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.