Package javax.transaction

Examples of javax.transaction.TransactionManager.rollback()


      assertEquals(0, c.getTransactionTable().getNumGlobalTransactions());
      assertEquals(0, c.getTransactionTable().getNumLocalTransactions());

      mgr.begin();
      c.put("/one/two", "key1", "value");
      mgr.rollback();
      assertNull(mgr.getTransaction());
      assertEquals(0, c.getTransactionTable().getNumGlobalTransactions());
      assertEquals(0, c.getTransactionTable().getNumLocalTransactions());

      //make sure all calls were done in right order
View Full Code Here


      SamplePojo pojo = new SamplePojo(21, "test");

      cache.put("/one/two", "key1", pojo);

      mgr.rollback();

      assertNull(mgr.getTransaction());
      assertEquals(0, cache.getTransactionTable().getNumGlobalTransactions());
      assertEquals(0, cache.getTransactionTable().getNumLocalTransactions());
View Full Code Here

      mgr.begin();

      cache.put("/one/two/three", "key1", "val1");
      cache.put("/one/two/three/four", "key2", "val2");
      log.debug("NODE1 " + cache.getNode("/one/two/three").getData());
      mgr.rollback();
      log.debug("NODE2 " + cache.getNode("/one/two/three"));
      assertEquals(null, cache.get("/one/two/three", "key1"));
      assertEquals(null, cache.get("/one/two/three/four", "key2"));
      addDelay();
      assertNull("Loader should not have node /one/two/three", loader.get(Fqn.fromString("/one/two/three")));
View Full Code Here

   {

      CacheSPI<Object, Object> cache = createCacheWithListener();

      TransactionManager mgr = cache.getConfiguration().getRuntimeConfig().getTransactionManager();
      if (mgr.getTransaction() != null) mgr.rollback();
      assertNull(mgr.getTransaction());

      // first put in a value
      mgr.begin();
View Full Code Here

   {
      CacheSPI<Object, Object> cache = createCacheWithListener();
      Set keys;

      TransactionManager mgr = cache.getConfiguration().getRuntimeConfig().getTransactionManager();
      if (mgr.getTransaction() != null) mgr.rollback();
      assertNull(mgr.getTransaction());

      // first put in a value
      mgr.begin();
      assertEquals(0, cache.getTransactionTable().getNumGlobalTransactions());
View Full Code Here

      SamplePojo pojo = new SamplePojo(21, "test");

      cache.put("/one/two", "key1", pojo);

      mgr.rollback();

      assertNull(mgr.getTransaction());
      assertEquals(0, cache.getTransactionTable().getNumGlobalTransactions());
      assertEquals(0, cache.getTransactionTable().getNumLocalTransactions());
View Full Code Here

      SamplePojo pojo = new SamplePojo(21, "test");

      cache.put("/one/two", "key1", pojo);

      assertNotNull(mgr.getTransaction());
      mgr.rollback();

      assertNull(mgr.getTransaction());

      List<?> calls = dummy.getAllCalledIds();
      assertEquals(1, calls.size());
View Full Code Here

      //start local transaction
      mgr.begin();

      assertNotNull(mgr.getTransaction());
      mgr.rollback();

      assertNull(mgr.getTransaction());

      List<?> calls = dummy.getAllCalled();
      assertEquals(0, calls.size());
View Full Code Here

         assertTrue(!cache.exists("/a/b/c"));
         assertTrue(cache.exists("/a/b/d"));
         dataContainer.printLockInfo();
      }
      catch (Exception ex) {
         tm.rollback();
         throw ex;
      }
      dataContainer.printLockInfo();
      System.out.println(" lock info " + dataContainer.printLockInfo());
      try
View Full Code Here

      assertEquals(OptimisticPrepareCommand.METHOD_ID, calls.get(0));
      assertEquals(CommitCommand.METHOD_ID, calls.get(1));
      boolean failed = false;
      try
      {
         mgr.rollback();
         fail();
      }
      catch (Exception e)
      {
         failed = true;
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.