Skip to content
Permalink
Browse files
GERONIMO-4519 When XAException.XA_RBROLLBACK arisen from XAResource.e…
…nd, TM should not send rollback request again to the XAResource

git-svn-id: https://svn.apache.org/repos/asf/geronimo/components/txmanager/trunk@735101 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Lin Sun committed Jan 16, 2009
1 parent ae7850b commit ec256652e165e25a829370a5320710dc45038a8c
Showing 1 changed file with 6 additions and 1 deletion.
@@ -475,10 +475,10 @@ public void rollback() throws IllegalStateException, SystemException {
default:
throw new IllegalStateException("Status is " + getStateString(status));
}
rms = resourceManagers;
}

endResources();
rms = resourceManagers;
try {
rollbackResources(rms);
//only write rollback record if we have already written prepare record.
@@ -573,6 +573,11 @@ private void endResources(IdentityHashMap resourceMap) {
log.warn("Error ending association for XAResource " + xaRes + "; transaction will roll back. XA error code: " + e.errorCode, e);
synchronized (this) {
status = Status.STATUS_MARKED_ROLLBACK;
// when XAException is XA_RBROLLBACK, which indicates that XAResource has already rolled back the transaction, no need
// to send rollback request to the XAResource, thus remove it off resourceManagers list.
if (e.errorCode == XAException.XA_RBROLLBACK) {
resourceManagers.remove(manager);
}
}
}
}

0 comments on commit ec25665

Please sign in to comment.