Source:
<code>private Object verifyRemoteTransaction(RemoteTxInvocationContext ctx, AbstractTransactionBoundaryCommand command, Object rv, Throwable throwable) throws Throwable { final GlobalTransaction globalTransaction = command.getGlobalTransaction(); final Address origin = globalTransaction.getAddress(); boolean originatorMissing = !rpcManager.getTransport().getMembers().contains(origin); boolean alreadyCompleted = txTable.isTransactionCompleted(globalTransaction) || !txTable.containRemoteTx(globalTransaction); boolean completedSuccessfully = alreadyCompleted && !ctx.getCacheTransaction().isMarkedForRollback(); boolean canRollback = command instanceof PrepareCommand && !((PrepareCommand) command).isOnePhaseCommit() || command instanceof RollbackCommand || command instanceof LockControlCommand; if (trace) { log.tracef("Verifying transaction: originatorMissing=%s, alreadyCompleted=%s", originatorMissing, alreadyCompleted); } if (alreadyCompleted || (originatorMissing && (canRollback || partitionHandlingManager.canRollbackTransactionAfterOriginatorLeave(globalTransaction)))) { if (trace) { log.tracef("Rolling back remote transaction %s because either already completed (%s) or originator no longer in the cluster (%s).", globalTransaction, alreadyCompleted, originatorMissing); } <START> txTable.markTransactionCompleted(globalTransaction, false); <END> RollbackCommand rollback = commandsFactory.buildRollbackCommand(command.getGlobalTransaction()); return invokeNextAndFinally(ctx, rollback, (rCtx, rCommand, rv1, throwable1) -> { RemoteTransaction remoteTx = ((TxInvocationContext<RemoteTransaction>) rCtx).getCacheTransaction(); remoteTx.markForRollback(true); txTable.removeRemoteTransaction(globalTransaction); if (throwable1 == null) { if (originatorMissing && !completedSuccessfully) { throw log.orphanTransactionRolledBack(globalTransaction); } } }); } return valueOrException(rv, throwable); }</code><technical_language>Is this place marks transaction for rollback lock command fails? is user handle exception thrown operation mark tx</technical_language>

Target:
private Object verifyRemoteTransaction(RemoteTxInvocationContext ctx, AbstractTransactionBoundaryCommand command, Object rv, Throwable throwable) throws Throwable { final GlobalTransaction globalTransaction = command.getGlobalTransaction(); boolean alreadyCompleted = txTable.isTransactionCompleted(globalTransaction) || !txTable.containRemoteTx(globalTransaction); boolean canRollback = command instanceof PrepareCommand && !((PrepareCommand) command).isOnePhaseCommit() || command instanceof LockControlCommand; if (trace) { log.tracef("Verifying transaction: alreadyCompleted=%s", alreadyCompleted); } if (alreadyCompleted) { if (trace) { log.tracef("Rolling back remote transaction %s because it was already completed", globalTransaction); } txTable.markTransactionCompleted(globalTransaction, false); RollbackCommand rollback = commandsFactory.buildRollbackCommand(command.getGlobalTransaction()); return invokeNextAndFinally(ctx, rollback, (rCtx, rCommand, rv1, throwable1) -> { RemoteTransaction remoteTx = ((TxInvocationContext<RemoteTransaction>) rCtx).getCacheTransaction(); remoteTx.markForRollback(true); txTable.removeRemoteTransaction(globalTransaction); }); } return valueOrException(rv, throwable); }