Package javax.transaction

Examples of javax.transaction.TransactionManager.commit()


      assertEquals("value", cache1.get(fqn, "key"));

      txm.begin();
      cache2.put(fqn, "key", "value");
      assertEquals("value", cache2.get(fqn, "key"));
      txm.commit();

      // since the node already exists even PL will not remove it - but will invalidate it's data
      Node n = cache1.getNode(fqn);
      CacheLoaderInvalidationTest.assertHasBeenInvalidated(n, "Should have been invalidated");
      assertEquals("value", cache2.get(fqn, "key"));
View Full Code Here


      assertEquals("value", cache2.get(fqn, "key"));

      txm.begin();
      cache1.put(fqn, "key2", "value2");
      assertEquals("value2", cache1.get(fqn, "key2"));
      txm.commit();

      assertEquals("value2", cache1.get(fqn, "key2"));
      // since the node already exists even PL will not remove it - but will invalidate it's data
      n = cache2.getNode(fqn);
      CacheLoaderInvalidationTest.assertHasBeenInvalidated(n, "Should have been invalidated");
View Full Code Here

      }

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

      tm.begin();
      try
      {
         // Remove a node that doesn't exist in cache2
         cache2.removeNode(fqn);
         tm.commit();
      }
      catch (Exception e)
      {
         String msg = "Unable to remove non-existent node " + fqn;
         fail(msg + " -- " + e);
View Full Code Here

      tm.begin();
      try
      {
         // Remove a node that doesn't exist in cache2
         cache2.removeNode(fqn);
         tm.commit();
      }
      catch (Exception e)
      {
         String msg = "Unable to remove non-existent node " + fqn;
         fail(msg + " -- " + e);
View Full Code Here

      assertNull("Should be null", caches.get(1).get(fqn, "key"));
      mgr.begin();
      caches.get(0).put(fqn, "key", "value");
      assertEquals("value", caches.get(0).get(fqn, "key"));
      assertNull("Should be null", caches.get(1).get(fqn, "key"));
      mgr.commit();
      assertEquals("value", caches.get(1).get(fqn, "key"));
      assertEquals("value", caches.get(0).get(fqn, "key"));

      mgr.begin();
      caches.get(0).put(fqn, "key2", "value2");
View Full Code Here

      }

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

      }

      mgr2.resume(tx2);
      try
      {
         mgr2.commit();
         assertTrue("Ought to have failed!", false);
      }
      catch (RollbackException roll)
      {
         assertTrue("Ought to have failed!", true);
View Full Code Here

      cache1.put(fqn, "key1", "val1");
      cache1.put("/one/two/three/four", "key2", "val2");
      assertNull(cache2.get(fqn, "key1"));
      assertNull(cache2.get("/one/two/three/four", "key2"));
      mgr.commit();
      assertNotNull(cache1.getNode(fqn).getKeys());
      Set<?> children = cache1.getNode("/one").getChildrenNames();
      assertEquals(1, children.size());
      TestingUtil.sleepThread(2000);
      assertEquals("val1", cache2.get(fqn, "key1"));
View Full Code Here

      txm.begin();
      cache2.put(fqn, "key", "value");
      assertEquals("value", cache2.get(fqn, "key"));
      assertEquals("value2", cache1.get(fqn, "key2"));
      txm.commit();

      n1 = cache1.getNode(fqn);
      CacheLoaderInvalidationTest.assertHasBeenInvalidated(n1, "Should have been invalidated");
      CacheLoaderInvalidationTest.assertHasBeenInvalidated(cache1.peek(fqn, false, false), "Should have been invalidated");
      assertEquals("value", cache2.get(fqn, "key"));
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.