Package org.infinispan.transaction

Examples of org.infinispan.transaction.GlobalTransaction


    * @return result of the prepare, typically a null.
    * @throws Throwable in the event of problems.
    */
   private Object handleRemotePrepare(InvocationContext ctx, PrepareCommand command) throws Throwable {
      // the InvocationContextInterceptor would have set this for us
      GlobalTransaction gtx = ctx.getGlobalTransaction();

      // Is there a local transaction associated with GTX?  (not the current tx associated with the thread, which may be
      // in the invocation context
      Transaction ltx = txTable.getLocalTransaction(gtx);
      Transaction currentTx = txManager.getTransaction();
View Full Code Here


   private ReplicableCommand attachGlobalTransaction(InvocationContext ctx, Transaction tx, VisitableCommand command) throws Throwable {
      if (trace) {
         log.trace(" local transaction exists - registering global tx if not present for " + Thread.currentThread());
      }
      if (trace) {
         GlobalTransaction tempGtx = txTable.get(tx);
         log.trace("Associated gtx in txTable is " + tempGtx);
      }

      // register a sync handler for this tx - only if the globalTransaction is not remotely initiated.
      GlobalTransaction gtx = registerTransaction(tx, ctx);
      if (gtx == null) {
         // get the current globalTransaction from the txTable.
         gtx = txTable.get(tx);
      }
View Full Code Here

    * passes the meth call up the interceptor chain.
    *
    * @throws Throwable
    */
   private Object handleCommitRollback(InvocationContext ctx, VisitableCommand command) throws Throwable {
      GlobalTransaction gtx = ctx.getGlobalTransaction();
      Object result;
      result = invokeNextInterceptor(ctx, command);
      if (log.isDebugEnabled()) log.debug("Finished local commit/rollback method for " + gtx);
      return result;
   }
View Full Code Here

      // transaction is in a valid state before moving on, and throwing an exception if not.
      boolean txValid = TransactionTable.isValid(tx);
      if (!txValid)
         throw new IllegalStateException("Transaction " + tx + " is not in a valid state to be invoking cache operations on.");

      GlobalTransaction gtx;

      if (transactions.add(tx)) {
         gtx = txTable.getCurrentTransaction(tx, true);
         TransactionContext transactionContext;
         if (ctx.getGlobalTransaction() == null) {
            ctx.setGlobalTransaction(gtx);
            transactionContext = txTable.getTransactionContext(gtx);
            ctx.setTransactionContext(transactionContext);
         } else {
            transactionContext = ctx.getTransactionContext();
         }
         if (gtx.isRemote()) {
            // should be no need to register a handler since this a remotely initiated globalTransaction
            if (trace) log.trace("is a remotely initiated gtx so no need to register a tx for it");
         } else {
            if (trace) log.trace("Registering sync handler for tx {0} and gtx {1}", tx, gtx);
View Full Code Here

TOP

Related Classes of org.infinispan.transaction.GlobalTransaction

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.