Package org.infinispan.commands.tx

Examples of org.infinispan.commands.tx.CommitCommand


            break;
         case CommitCommand.COMMAND_ID:
         case VersionedCommitCommand.COMMAND_ID:
         case TotalOrderCommitCommand.COMMAND_ID:
         case TotalOrderVersionedCommitCommand.COMMAND_ID:
            CommitCommand commitCommand = (CommitCommand) c;
            commitCommand.init(interceptorChain, icf, txTable);
            commitCommand.markTransactionAsRemote(isRemote);
            break;
         case RollbackCommand.COMMAND_ID:
         case TotalOrderRollbackCommand.COMMAND_ID:
            RollbackCommand rollbackCommand = (RollbackCommand) c;
            rollbackCommand.init(interceptorChain, icf, txTable);
View Full Code Here


      }
      throw new XAException(XAException.XA_HEURRB); //this is a heuristic rollback
   }

   private void commitInternal(LocalTxInvocationContext ctx) throws XAException {
      CommitCommand commitCommand = commandCreator.createCommitCommand(ctx.getGlobalTransaction());
      try {
         invoker.invoke(ctx, commitCommand);
         txTable.removeLocalTransaction(ctx.getCacheTransaction());
      } catch (Throwable e) {
         handleCommitFailure(e, false, ctx);
View Full Code Here

      command.setCacheName(cacheName);
      return command;
   }

   public CommitCommand buildCommitCommand(GlobalTransaction gtx) {
      CommitCommand commitCommand = new CommitCommand(gtx);
      commitCommand.setCacheName(cacheName);
      return commitCommand;
   }
View Full Code Here

               DldGlobalTransaction transaction = (DldGlobalTransaction) pc.getGlobalTransaction();
               transaction.setLocksHeldAtOrigin(pc.getAffectedKeys());
            }
            break;
         case CommitCommand.COMMAND_ID:
            CommitCommand commitCommand = (CommitCommand) c;
            commitCommand.init(interceptorChain, icc, txTable);
            commitCommand.markTransactionAsRemote(isRemote);
            break;
         case RollbackCommand.COMMAND_ID:
            RollbackCommand rollbackCommand = (RollbackCommand) c;
            rollbackCommand.init(interceptorChain, icc, txTable);
            rollbackCommand.markTransactionAsRemote(isRemote);
View Full Code Here

            break;
         case PrepareCommand.COMMAND_ID:
            command = new PrepareCommand();
            break;
         case CommitCommand.COMMAND_ID:
            command = new CommitCommand();
            break;
         case RollbackCommand.COMMAND_ID:
            command = new RollbackCommand();
            break;
         case MultipleRpcCommand.COMMAND_ID:
View Full Code Here

               txTable.failureCompletingTransaction(ctx.getTransaction());
               log.errorProcessing1pcPrepareCommand(e);
               throw new XAException(XAException.XAER_RMERR);
            }
         } else {
            CommitCommand commitCommand = commandsFactory.buildCommitCommand(localTransaction.getGlobalTransaction());
            try {
               invoker.invoke(ctx, commitCommand);
               txTable.removeLocalTransaction(localTransaction);
            } catch (Throwable e) {
               txTable.failureCompletingTransaction(ctx.getTransaction());
View Full Code Here

      Address local = new JGroupsAddress(new IpAddress(12345));
      GlobalTransaction gtx = gtf.newGlobalTransaction(local, false);
      PrepareCommand c11 = new PrepareCommand(cacheName, gtx, true, c5, c6, c8, c10);
      marshallAndAssertEquality(c11);

      CommitCommand c12 = new CommitCommand(cacheName, gtx);
      marshallAndAssertEquality(c12);

      RollbackCommand c13 = new RollbackCommand(cacheName, gtx);
      marshallAndAssertEquality(c13);
View Full Code Here

         @Override
         public Object call() throws Exception {
            // Wait for the commit command to block replaying the prepare on the new backup
            sequencer.advance("sim:before_extra_commit");
            // And try to run another commit command
            CommitCommand command = new CommitCommand(newBackupOwnerCache.getName(), gtx);
            command.setTopologyId(currentTopologyId);
            CommandsFactory cf = TestingUtil.extractCommandsFactory(newBackupOwnerCache);
            cf.initializeReplicableCommand(command, true);
            try {
               command.perform(null);
            } catch (Throwable throwable) {
               throw new CacheException(throwable);
            }

            return null;
View Full Code Here

      Address local = new JGroupsAddress(new IpAddress(12345));
      GlobalTransaction gtx = new GlobalTransaction(local, false);
      PrepareCommand c11 = new PrepareCommand(gtx, true, c5, c6, c8, c10);
      checkEqualityAndSize(c11);

      CommitCommand c12 = new CommitCommand(gtx);
      checkEqualityAndSize(c12);

      RollbackCommand c13 = new RollbackCommand(gtx);
      checkEqualityAndSize(c13);
View Full Code Here

      Address local = new JGroupsAddress(new IpAddress(12345));
      GlobalTransaction gtx = new GlobalTransaction(local, false);
      PrepareCommand c11 = new PrepareCommand(gtx, true, c5, c6, c8, c10);
      marshallAndAssertEquality(c11);

      CommitCommand c12 = new CommitCommand(gtx);
      marshallAndAssertEquality(c12);

      RollbackCommand c13 = new RollbackCommand(gtx);
      marshallAndAssertEquality(c13);
View Full Code Here

TOP

Related Classes of org.infinispan.commands.tx.CommitCommand

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.