Package javax.transaction

Examples of javax.transaction.TransactionManager.commit()


      assert c1Replica.isEmpty();

      TransactionManager tm = TestingUtil.getTransactionManager(c1);
      tm.begin();
      c1.put("c1key", "c1value");
      tm.commit();

      assert c1.get("c1key").equals("c1value");
      assert c1Replica.get("c1key").equals("c1value");

      tm.begin();
View Full Code Here


      assert c1.get("c1key").equals("c1value");
      assert c1Replica.get("c1key").equals("c1value");

      tm.begin();
      c1.putIfAbsent("c1key", "SHOULD_NOT_GET_INSERTED");
      tm.commit();

      assert c1.get("c1key").equals("c1value");
      assert c1Replica.get("c1key").equals("c1value");
   }
View Full Code Here

      assertMap(expectedMap, map1);
      assertMap(expectedMap, map2);

      tm1.begin();
      map1.put("k1", "initial");
      tm1.commit();

      expectedMap = createMap("k1", "initial");
      assertMap(expectedMap, map1);
      assertMap(expectedMap, map2);
View Full Code Here

      tm1.begin();
      map1.put("k1", "v1");
      map1.put("k2", "v2");
      map1.put("k3", "v3");
      tm1.commit();

      expectedMap = createMap("k1", "v1", "k2", "v2", "k3", "v3");
      assertMap(expectedMap, map1);
      assertMap(expectedMap, map2);
View Full Code Here

      tm1.begin();
      map1.put("k4", "v4");
      map1.put("k5", "v5");
      map1.put("k6", "v6");
      tm1.commit();

      expectedMap = createMap("k1", "v1", "k2", "v2", "k3", "v3", "k4", "v4", "k5", "v5", "k6", "v6");
      assertMap(expectedMap, map1);
      assertMap(expectedMap, map2);
   }
View Full Code Here

      tm1.begin();
      assertSize(cache1, 1);
      cache1.put(new MagicKey("Need", cache1), "Read Consistency");
      assertSize(cache1, 2);
      tm1.commit();
      assertSize(cache1, 2);

      tm1.begin();
      assertSize(cache1, 2);
      cache1.put(new MagicKey("Need Also", cache1), "Speed");
View Full Code Here

      assertSize(cache1, 3);
      atomicMap = createAtomicMap(cache1, new MagicKey("testSizeOnCache-second", cache1), true);
      assertSize(cache1, 4);
      atomicMap.put("mm", "nn");
      assertSize(cache1, 4);
      tm1.commit();
      assertSize(cache1, 4);

      tm1.begin();
      assertSize(cache1, 4);
      atomicMap = createAtomicMap(cache1, new MagicKey("testSizeOnCache-third", cache1), true);
View Full Code Here

         @Override
         public void run() {
            try {
               tm2.begin();
               map2.put("k2", "tx2Value");
               tm2.commit();
            } catch (Exception e) {
               log.error(e);
            }
         }
      }, false);
View Full Code Here

      // tx2
      tm2.resume(tx2);
      // a new FGAM referring to the same key should not see the entries committed by tx3
      assertMap(initialMap, readMap);
      tm2.commit();

      // tx4
      assertMap(modifiedMap, writeMap);
      assertMap(modifiedMap, readMap);
   }
View Full Code Here

      AssertJUnit.assertEquals("v1", atomicMap.get("k1"));
      final Transaction tx2 = tm.suspend();

      tm.resume(tx1);
      atomicMap.put("k1", "v2");
      tm.commit();

      tm.resume(tx2);
      AssertJUnit.assertEquals("v1", atomicMap.get("k1"));
      atomicMap.put("k1", "v3");
      try {
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.