Package org.infinispan.transaction.xa

Examples of org.infinispan.transaction.xa.TransactionXaAdapter


      }
   }

   public static void assertPrepared(int count, DummyTransaction...tx) throws XAException {
      for (DummyTransaction dt : tx) {
         TransactionXaAdapter xaRes = (TransactionXaAdapter) dt.firstEnlistedResource();
         assertEquals(count, xaRes.recover(XAResource.TMSTARTRSCAN | XAResource.TMENDRSCAN).length);
      }
   }
View Full Code Here


   }

   public void testOneTx() throws Exception {
      dummyTm().begin();
      cache.put("k", "v");
      TransactionXaAdapter xaRes = (TransactionXaAdapter) dummyTm().firstEnlistedResource();
      assertPrepared(0, dummyTm().getTransaction());
      xaRes.prepare(xaRes.getLocalTransaction().getXid());
      assertPrepared(1, dummyTm().getTransaction());
      final DummyTransaction suspend = (DummyTransaction) dummyTm().suspend();

      xaRes.commit(xaRes.getLocalTransaction().getXid(), false);
      assertPrepared(0, suspend);
      assertEquals(0, TestingUtil.getTransactionTable(cache).getLocalTxCount());
   }
View Full Code Here

      txTable.addLocalTransactionMapping(localTx);     

      configuration = new ConfigurationBuilder().build();
      txCoordinator = new TransactionCoordinator();
      txCoordinator.init(null, null, null, null, configuration);
      xaAdapter = new TransactionXaAdapter(localTx, txTable, null, txCoordinator, null, null,
                                           new ClusteringDependentLogic.InvalidationLogic(), configuration, "");
   }
View Full Code Here

      return new StatsImpl(invoker);
   }

   @Override
   public XAResource getXAResource() {
      return new TransactionXaAdapter(null, txTable, config, recoveryManager, txCoordinator);
   }
View Full Code Here

TOP

Related Classes of org.infinispan.transaction.xa.TransactionXaAdapter

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.