[ARTEMIS-591] Wrong XAException return code when broker timeout is hit
This commit is contained in:
parent
a349ebfab5
commit
3def84e533
|
@ -855,9 +855,16 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
|
|||
else if (tx.getState() == Transaction.State.ROLLEDBACK) {
|
||||
final String msg = "Cannot end, transaction is rolled back";
|
||||
|
||||
final long now = System.currentTimeMillis();
|
||||
final boolean timeout = tx.hasTimedOut(now, resourceManager.getTimeoutSeconds());
|
||||
tx = null;
|
||||
|
||||
throw new ActiveMQXAException(XAException.XAER_PROTO, msg);
|
||||
if (timeout) {
|
||||
throw new ActiveMQXAException(XAException.XA_RBTIMEOUT, msg);
|
||||
}
|
||||
else {
|
||||
throw new ActiveMQXAException(XAException.XAER_PROTO, msg);
|
||||
}
|
||||
}
|
||||
else {
|
||||
tx = null;
|
||||
|
|
Loading…
Reference in New Issue