use of org.apache.geode.internal.cache.TXRemoteCommitMessage.RemoteCommitResponse in project geode by apache.
the class PeerTXStateStub method afterCompletion.
@Override
public void afterCompletion(int status) {
RemoteCommitResponse response = JtaAfterCompletionMessage.send(this.proxy.getCache(), this.proxy.getTxId().getUniqId(), getOriginatingMember(), status, this.target);
try {
this.proxy.getTxMgr().setTXState(null);
this.commitMessage = response.waitForResponse();
if (logger.isDebugEnabled()) {
logger.debug("afterCompletion received commit response of {}", this.commitMessage);
}
} catch (Exception e) {
throw new TransactionException(e);
// TODO throw a better exception
} finally {
cleanup();
}
}
use of org.apache.geode.internal.cache.TXRemoteCommitMessage.RemoteCommitResponse in project geode by apache.
the class JtaAfterCompletionMessage method send.
public static RemoteCommitResponse send(Cache cache, int txId, InternalDistributedMember onBehalfOfClientMember, int status, DistributedMember recipient) {
final InternalDistributedSystem system = (InternalDistributedSystem) cache.getDistributedSystem();
final Set recipients = Collections.singleton(recipient);
RemoteCommitResponse response = new RemoteCommitResponse(system, recipients);
JtaAfterCompletionMessage msg = new JtaAfterCompletionMessage(status, txId, onBehalfOfClientMember, response);
msg.setRecipients(recipients);
// bug #43087 - hang sending JTA synchronizations from delegate server
if (system.threadOwnsResources()) {
msg.processorType = DistributionManager.SERIAL_EXECUTOR;
} else {
msg.processorType = DistributionManager.HIGH_PRIORITY_EXECUTOR;
}
system.getDistributionManager().putOutgoing(msg);
return response;
}
Aggregations