Package org.jboss.cache.transaction

Examples of org.jboss.cache.transaction.GlobalTransaction


      }
   }

   private void prepareCacheLoader(InvocationContext ctx) throws Throwable
   {
      GlobalTransaction gtx = ctx.getGlobalTransaction();
      TransactionContext tCtx = ctx.getTransactionContext();
      if (tCtx == null)
      {
         throw new Exception("tCtx for transaction " + gtx + " not found in transaction table");
      }
View Full Code Here


    *    - the current transaction did not modify any data
    * </pre>
    */
   protected boolean skipReplicationOfTransactionMethod(InvocationContext ctx)
   {
      GlobalTransaction gtx = ctx.getGlobalTransaction();
      return ctx.getTransaction() == null || gtx == null || gtx.isRemote() || ctx.getOptionOverrides().isCacheModeLocal() || !ctx.getTransactionContext().hasModifications();
   }
View Full Code Here

   /**
    * The call runs in a transaction and it was initiated on this node of the cluster.
    */
   protected boolean isTransactionalAndLocal(InvocationContext ctx)
   {
      GlobalTransaction gtx = ctx.getGlobalTransaction();
      boolean isInitiatedHere = gtx != null && !gtx.isRemote();
      return isInitiatedHere && (ctx.getTransaction() != null);
   }
View Full Code Here

      return activations;
   }

   private void prepareCacheLoader(InvocationContext ctx) throws Throwable
   {
      GlobalTransaction gtx = ctx.getGlobalTransaction();
      TransactionContext tCtx = ctx.getTransactionContext();
      if (tCtx == null)
      {
         throw new Exception("tCtx for transaction " + gtx + " not found in transaction table");
      }
View Full Code Here

         return null;
      }
      try
      {
         if (trace) log.trace("(" + rpcManager.getLocalAddress() + ") call on command [" + command + "]");
         GlobalTransaction gtx = ctx.getGlobalTransaction();
         Transaction ltx = txTable.getLocalTransaction(gtx, true);
         // disconnect if we have a current tx associated
         Transaction currentTx = txManager.getTransaction();
         boolean resumeCurrentTxOnCompletion = false;
         try
View Full Code Here

         return null;
      }
      try
      {
         if (trace) log.trace("(" + rpcManager.getLocalAddress() + ") call on command [" + command + "]");
         GlobalTransaction gtx = ctx.getGlobalTransaction();
         Transaction ltx = txTable.getLocalTransaction(gtx);
         if (ltx == null)
         {
            log.warn("No local transaction for this remotely originating rollback.  Possibly rolling back before a prepare call was broadcast?");
            txTable.remove(gtx);
View Full Code Here

    * @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

      {
         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)
      {
         command = replaceGtx(command, gtx);
      }
      else
View Full Code Here

    * @throws Throwable
    */
   @SuppressWarnings("deprecation")
   private Object handleCommitRollback(InvocationContext ctx, VisitableCommand command) throws Throwable
   {
      GlobalTransaction gtx = ctx.getGlobalTransaction();
      Object result;
      VisitableCommand originalCommand = ctx.getCommand();
      ctx.setCommand(command);
      try
      {
View Full Code Here

   /**
    * Creates a gtx (if one doesnt exist), a sync handler, and registers the tx.
    */
   private GlobalTransaction registerTransaction(Transaction tx, InvocationContext ctx) throws Exception
   {
      GlobalTransaction gtx;

      if (TransactionTable.isValid(tx) && transactions.add(tx))
      {
         gtx = txTable.getCurrentTransaction(tx, true);
         TransactionContext transactionContext;
         if (ctx.getGlobalTransaction() == null)
         {
            ctx.setGlobalTransaction(gtx);
            transactionContext = txTable.get(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
View Full Code Here

TOP

Related Classes of org.jboss.cache.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.