/** Removes the {@link RemoteTransaction} corresponding to the given tx. */
 public void remoteTransactionCommitted(GlobalTransaction gtx, boolean onePc) {
   boolean optimisticWih1Pc =
       onePc && (configuration.transaction().lockingMode() == LockingMode.OPTIMISTIC);
   if (Configurations.isSecondPhaseAsync(configuration)
       || configuration.transaction().transactionProtocol().isTotalOrder()
       || optimisticWih1Pc) {
     removeRemoteTransaction(gtx);
   }
 }
 @Override
 public Object visitCommitCommand(TxInvocationContext ctx, CommitCommand command)
     throws Throwable {
   if (Configurations.isOnePhaseTotalOrderCommit(cacheConfiguration) || !ctx.hasModifications()) {
     return invokeNextInterceptor(ctx, command);
   }
   totalOrderTxCommit(ctx);
   return super.visitCommitCommand(ctx, command);
 }
 @Override
 public Object visitRollbackCommand(TxInvocationContext ctx, RollbackCommand command)
     throws Throwable {
   if (Configurations.isOnePhaseTotalOrderCommit(cacheConfiguration)
       || !ctx.hasModifications()
       || !shouldTotalOrderRollbackBeInvokedRemotely(ctx)) {
     return invokeNextInterceptor(ctx, command);
   }
   totalOrderTxRollback(ctx);
   return super.visitRollbackCommand(ctx, command);
 }
 public AbstractEnlistmentAdapter(
     CommandsFactory commandsFactory,
     RpcManager rpcManager,
     TransactionTable txTable,
     ClusteringDependentLogic clusteringLogic,
     Configuration configuration) {
   this.commandsFactory = commandsFactory;
   this.rpcManager = rpcManager;
   this.txTable = txTable;
   this.clusteringLogic = clusteringLogic;
   this.isSecondPhaseAsync = Configurations.isSecondPhaseAsync(configuration);
   this.isPessimisticLocking =
       configuration.transaction().lockingMode() == LockingMode.PESSIMISTIC;
   hashCode = 31;
 }
 /** Removes the {@link RemoteTransaction} corresponding to the given tx. */
 public void remoteTransactionCommitted(GlobalTransaction gtx) {
   if (Configurations.isSecondPhaseAsync(configuration)) {
     removeRemoteTransaction(gtx);
   }
 }