localTransaction.clearRemoteLocksAcquired();
return completeTransaction(localTransaction, commit, xid);
} else {
RecoveryAwareRemoteTransaction tx = getPreparedTransaction(xid);
if (tx == null) return "Could not find transaction " + xid;
GlobalTransaction globalTransaction = tx.getGlobalTransaction();
globalTransaction.setAddress(rpcManager.getAddress());
globalTransaction.setRemote(false);
RecoveryAwareLocalTransaction localTx = (RecoveryAwareLocalTransaction) txFactory.newLocalTransaction(null, globalTransaction, false, tx.getTopologyId());
localTx.setModifications(tx.getModifications());
localTx.setXid(xid);
localTx.addAllAffectedKeys(tx.getAffectedKeys());
for (Object lk : tx.getLockedKeys()) localTx.registerLockedKey(lk);