Package org.infinispan.transaction.tm

Examples of org.infinispan.transaction.tm.DummyTransactionManager.suspend()


      // get a lock on cache 2 and hold on to it.
      DummyTransactionManager tm = (DummyTransactionManager) TestingUtil.getTransactionManager(cache2);
      tm.begin();
      cache2.put("block", "block");
      assert tm.getTransaction().runPrepare();
      tm.suspend();
      cache1.put("block", "v");
   }

   static class NonSerializabeData {
      int i;
View Full Code Here


      tm.begin();
      cache.put("k", "v");
      assert tm.getTransaction().runPrepare();
      assertLocked("k");
      tm.getTransaction().runCommitTx();
      tm.suspend();

      assertNoLocks();

      tm.begin();
      assert cache.get("k").equals("v");
View Full Code Here

      DummyTransactionManager tm = (DummyTransactionManager) tl.tm;
      tm.begin();
      cache.put("k", "v");
      final DummyTransaction transaction = tm.getTransaction();
      assert transaction.runPrepare();
      tm.suspend();

      tm.begin();
      cache.put("k", "v");
      assert !tm.getTransaction().runPrepare();
View Full Code Here

      tm.begin();
      cache.put("k", "v");
      assert tm.getTransaction().runPrepare();
      assertLocked("k");
      tm.getTransaction().runCommitTx();
      tm.suspend();

      assertNoLocks();

      tm.begin();
      assert cache.get("k").equals("v");
View Full Code Here

      DummyTransactionManager tm = (DummyTransactionManager) tl.tm;
      tm.begin();
      cache.put("k", "v");
      final DummyTransaction transaction = tm.getTransaction();
      assert transaction.runPrepare();
      tm.suspend();

      tm.begin();
      cache.put("k", "v");
      assert !tm.getTransaction().runPrepare();
View Full Code Here

      // get a lock on cache 2 and hold on to it.
      DummyTransactionManager tm = (DummyTransactionManager) TestingUtil.getTransactionManager(cache2);
      tm.begin();
      cache2.put("block", "block");
      assert tm.getTransaction().runPrepare();
      tm.suspend();
      cache1.put("block", "v");
   }

   static class NonSerializabeData {
      int i;
View Full Code Here

      tm.begin();
      cache.put("k", "v");
      tm.getTransaction().runPrepare();
      assertLocked("k");
      tm.getTransaction().runCommitTx();
      tm.suspend();

      assertNoLocks();

      tm.begin();
      assert cache.get("k").equals("v");
View Full Code Here

   public static DummyTransaction beginAndSuspendTx(Cache cache, Object key) {
      DummyTransactionManager dummyTm = (DummyTransactionManager) TestingUtil.getTransactionManager(cache);
      try {
         dummyTm.begin();
         cache.put(key, "v");
         return (DummyTransaction) dummyTm.suspend();
      } catch (Exception e) {
         throw new RuntimeException(e);
      }
   }
}
View Full Code Here

            originatorCache.put(key, "value");
            DummyTransaction tx = tm.getTransaction();

            boolean success = tx.runPrepare();
            assertTrue(success);
            tm.suspend();
            return tx;
         }
      });

      // Allow the tx thread to send the prepare command to the owners
View Full Code Here

      DummyTransaction tx = tm.getTransaction();

      boolean prepareSuccess = tx.runPrepare();
      assert prepareSuccess;

      tm.suspend();

      log.trace("Lock transfer happens here");
      killCache();

      checkNewTransactionFails(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.