Package org.infinispan.distribution.rehash

Examples of org.infinispan.distribution.rehash.XAResourceAdapter


      tm(0).begin();

      cache(0).put("k","v");

      if (multipleResources) {
         tm(0).getTransaction().enlistResource(new XAResourceAdapter());
      }

      assertEquals(lockManager(0).getNumberOfLocksHeld(), 0);
      assertEquals(lockManager(1).getNumberOfLocksHeld(), 0);
      assertEquals(lockManager(2).getNumberOfLocksHeld(), 0);
View Full Code Here


   public void testCommit() throws Exception {
      assertCommitRollback(0, 0, txInterceptor);
      tm.begin();
      //enlist another resource adapter to force TM to execute 2PC (otherwise 1PC)
      tm.getTransaction().enlistResource(new XAResourceAdapter());
      assertCommitRollback(0, 0, txInterceptor);
      cache1.put("key", "value");
      assertCommitRollback(0, 0, txInterceptor);
      tm.commit();
      assertCommitRollback(1, 0, txInterceptor);
View Full Code Here

   public void testRemoteCommit() throws Exception {
      assertCommitRollback(0, 0, txInterceptor2);
      tm.begin();
      assertCommitRollback(0, 0, txInterceptor2);
      //enlist another resource adapter to force TM to execute 2PC (otherwise 1PC)
      tm.getTransaction().enlistResource(new XAResourceAdapter());
      cache2.put("key", "value");
      assertCommitRollback(0, 0, txInterceptor2);
      tm.commit();
      assertCommitRollback(1, 0, txInterceptor2);
   }
View Full Code Here

   }

   protected void forceTwoPhase(int cacheIndex) throws SystemException, RollbackException {
      TransactionManager tm = tm(cacheIndex);
      Transaction tx = tm.getTransaction();
      tx.enlistResource(new XAResourceAdapter());
   }
View Full Code Here

      tm(0).begin();

      cache(0).put("k","v");

      if (multipleResources) {
         tm(0).getTransaction().enlistResource(new XAResourceAdapter());
      }

      assertEquals(lockManager(0).getNumberOfLocksHeld(), 0);
      assertEquals(lockManager(1).getNumberOfLocksHeld(), 0);
      assertEquals(lockManager(2).getNumberOfLocksHeld(), 0);
View Full Code Here

   }

   protected void forceTwoPhase(int cacheIndex) throws SystemException, RollbackException {
      TransactionManager tm = tm(cacheIndex);
      Transaction tx = tm.getTransaction();
      tx.enlistResource(new XAResourceAdapter());
   }
View Full Code Here

               break;
            }
            case FORCE2PC: {
               try {
                  TransactionManager txManager = TestingUtil.getTransactionManager(cache);
                  txManager.getTransaction().enlistResource(new XAResourceAdapter());
                  setResponse(OperationsResult.FORCE2PC_OK);
               } catch (Exception e) {
                  log.trace("Exception while executing replace(" + key + "," + value + ")", e);
                  setResponse(e);
               }
View Full Code Here

   }

   protected void forceTwoPhase(int cacheIndex) throws SystemException, RollbackException {
      TransactionManager tm = tm(cacheIndex);
      Transaction tx = tm.getTransaction();
      tx.enlistResource(new XAResourceAdapter());
   }
View Full Code Here

   }

   protected void forceTwoPhase(int cacheIndex) throws SystemException, RollbackException {
      TransactionManager tm = tm(cacheIndex);
      Transaction tx = tm.getTransaction();
      tx.enlistResource(new XAResourceAdapter());
   }
View Full Code Here

   public void testCommit() throws Exception {
      assertCommitRollback(0, 0, txInterceptor);
      tm.begin();
      //enlist another resource adapter to force TM to execute 2PC (otherwise 1PC)
      tm.getTransaction().enlistResource(new XAResourceAdapter());
      assertCommitRollback(0, 0, txInterceptor);
      cache1.put("key", "value");
      assertCommitRollback(0, 0, txInterceptor);
      tm.commit();
      assertCommitRollback(1, 0, txInterceptor);
View Full Code Here

TOP

Related Classes of org.infinispan.distribution.rehash.XAResourceAdapter

Copyright © 2018 www.massapicom. 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.