Examples of runPrepare()


Examples of org.infinispan.transaction.tm.DummyTransaction.runPrepare()

      Cache<String, String> cache = tl.cache;
      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

Examples of org.infinispan.transaction.tm.DummyTransaction.runPrepare()

      assertEquals(1, txTable0.getLocalTxCount());

      final Transaction tx2 = tm.suspend();

      tm.resume(k1LockOwner);
      k1LockOwner.runPrepare();
      tm.suspend();
      tm.resume(tx2);

      try {
         tm.commit();
View Full Code Here

Examples of org.infinispan.transaction.tm.DummyTransaction.runPrepare()

      final Object k = getKeyForCache(0);

      tm(0).begin();
      cache(0).put(k, "v");
      DummyTransaction dtm = (DummyTransaction) tm(0).getTransaction();
      dtm.runPrepare();
      tm(0).suspend();

      assert checkTxCount(0, 1, 0);
      assert checkTxCount(1, 0, 1);
      assert checkTxCount(2, 0, 1);
View Full Code Here

Examples of org.infinispan.transaction.tm.DummyTransaction.runPrepare()

      });


      log.trace("about to commit transaction.");
      tm(0).resume(dtm);
      dtm.runPrepare();
      dtm.runCommitTx();
      tm(0).suspend();

      assertValue(k, false);
View Full Code Here

Examples of org.infinispan.transaction.tm.DummyTransaction.runPrepare()

      assertNotLocked(k);

      tm(0).begin();
      operation.perform(k, 0);
      DummyTransaction dtm = (DummyTransaction) tm(0).getTransaction();
      dtm.runPrepare();
     
      assert !lockManager(0).isLocked(k);
      assert lockManager(1).isLocked(k);
      assert !lockManager(2).isLocked(k);
View Full Code Here

Examples of org.infinispan.transaction.tm.DummyTransaction.runPrepare()

      tm(0).begin();
      cache(0).put(k1, "v");
      cache(0).put(k2, "v");
      DummyTransaction dtm = (DummyTransaction) tm(0).getTransaction();
      dtm.runPrepare();

      assert !lockManager(0).isLocked(k1);
      assert lockManager(1).isLocked(k1);
      assert !lockManager(2).isLocked(k1);
      assert !lockManager(0).isLocked(k2);
View Full Code Here

Examples of org.infinispan.transaction.tm.DummyTransaction.runPrepare()

         public void run() {
            try {
               tm(cacheIndex).begin();
               cache(cacheIndex).put(k,"v");
               final DummyTransaction transaction = (DummyTransaction) tm(cacheIndex).getTransaction();
               transaction.runPrepare();
            } catch (Throwable e) {
               e.printStackTrace();
            }
         }
      }, false);
View Full Code Here

Examples of org.infinispan.transaction.tm.DummyTransaction.runPrepare()

      final int topologyId = stateTransferManager0.getCacheTopology().getTopologyId();

      tm(1).begin();
      cache(1).put(getKeyForCache(0),"v");
      final DummyTransaction t = (DummyTransaction) tm(1).getTransaction();
      t.runPrepare();
      tm(1).suspend();

      eventually(new Condition() {
         @Override
         public boolean isSatisfied() throws Exception {
View Full Code Here

Examples of org.infinispan.transaction.tm.DummyTransaction.runPrepare()

      DummyTransactionManager transactionManager = (DummyTransactionManager) tm(0);
      transactionManager.begin();
      cache(0).put(key, VALUE);
      final DummyTransaction transaction = transactionManager.getTransaction();
      transaction.runPrepare();
      assertEquals("Wrong transaction status before killing backup owner.",
                   Status.STATUS_PREPARED, transaction.getStatus());

      //now, we kill cache(1). the transaction is prepared in cache(1) and it should be forward to cache(2)
      killMember(1);
View Full Code Here

Examples of org.infinispan.transaction.tm.DummyTransaction.runPrepare()

      primaryOwnerCache.put(key, VALUE);

      final DummyTransaction transaction = transactionManager.getTransaction();
      TransactionTable transactionTable0 = TestingUtil.getTransactionTable(primaryOwnerCache);
      final GlobalTransaction gtx = transactionTable0.getLocalTransaction(transaction).getGlobalTransaction();
      transaction.runPrepare();
      assertEquals("Wrong transaction status before killing backup owner.",
            Status.STATUS_PREPARED, transaction.getStatus());

      // Now, we kill cache(1). the transaction is prepared in cache(1) and it should be transferred to cache(2)
      killMember(1);
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.