Skip to content

Commit

Permalink
[WFTC-61] the connection failures are intermittent and RMFAIL should …
Browse files Browse the repository at this point in the history
…be used

RMFAIL announces to transaction manager that the work could be retried
  • Loading branch information
ochaloup committed Apr 5, 2019
1 parent 5fc6489 commit 6f97244
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void rollback(final Xid xid, final ConnectionPeerIdentity peerIdentity) t
final int peerIdentityId = peerIdentity.getId();
if (peerIdentityId != 0) Protocol.writeParam(Protocol.P_SEC_CONTEXT, os, peerIdentityId, Protocol.UNSIGNED);
} catch (IOException e) {
throw Log.log.failedToSendXA(e, XAException.XAER_RMERR);
throw Log.log.failedToSendXA(e, XAException.XAER_RMFAIL);
}
try (BlockingInvocation.Response response = invocation.getResponse()) {
try (MessageInputStream is = response.getInputStream()) {
Expand Down Expand Up @@ -130,7 +130,7 @@ public void rollback(final Xid xid, final ConnectionPeerIdentity peerIdentity) t
throw Log.log.unrecognizedParameter(XAException.XAER_RMFAIL, id);
}
} catch (IOException e) {
throw Log.log.responseFailedXa(e, XAException.XAER_RMERR);
throw Log.log.responseFailedXa(e, XAException.XAER_RMFAIL);
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
Expand All @@ -153,7 +153,7 @@ public void setRollbackOnly(final Xid xid, final ConnectionPeerIdentity peerIden
final int peerIdentityId = peerIdentity.getId();
if (peerIdentityId != 0) Protocol.writeParam(Protocol.P_SEC_CONTEXT, os, peerIdentityId, Protocol.UNSIGNED);
} catch (IOException e) {
throw Log.log.failedToSendXA(e, XAException.XAER_RMERR);
throw Log.log.failedToSendXA(e, XAException.XAER_RMFAIL);
}
try (BlockingInvocation.Response response = invocation.getResponse()) {
try (MessageInputStream is = response.getInputStream()) {
Expand Down Expand Up @@ -188,7 +188,7 @@ public void setRollbackOnly(final Xid xid, final ConnectionPeerIdentity peerIden
throw Log.log.unrecognizedParameter(XAException.XAER_RMFAIL, id);
}
} catch (IOException e) {
throw Log.log.responseFailedXa(e, XAException.XAER_RMERR);
throw Log.log.responseFailedXa(e, XAException.XAER_RMFAIL);
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
Expand All @@ -210,7 +210,7 @@ public void beforeCompletion(final Xid xid, final ConnectionPeerIdentity peerIde
final int peerIdentityId = peerIdentity.getId();
if (peerIdentityId != 0) Protocol.writeParam(Protocol.P_SEC_CONTEXT, os, peerIdentityId, Protocol.UNSIGNED);
} catch (IOException e) {
throw Log.log.failedToSendXA(e, XAException.XAER_RMERR);
throw Log.log.failedToSendXA(e, XAException.XAER_RMFAIL);
}
try (BlockingInvocation.Response response = invocation.getResponse()) {
try (MessageInputStream is = response.getInputStream()) {
Expand Down Expand Up @@ -245,7 +245,7 @@ public void beforeCompletion(final Xid xid, final ConnectionPeerIdentity peerIde
throw Log.log.unrecognizedParameter(XAException.XAER_RMFAIL, id);
}
} catch (IOException e) {
throw Log.log.responseFailedXa(e, XAException.XAER_RMERR);
throw Log.log.responseFailedXa(e, XAException.XAER_RMFAIL);
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
Expand All @@ -268,7 +268,7 @@ public int prepare(final Xid xid, final ConnectionPeerIdentity peerIdentity) thr
final int peerIdentityId = peerIdentity.getId();
if (peerIdentityId != 0) Protocol.writeParam(Protocol.P_SEC_CONTEXT, os, peerIdentityId, Protocol.UNSIGNED);
} catch (IOException e) {
throw Log.log.failedToSendXA(e, XAException.XAER_RMERR);
throw Log.log.failedToSendXA(e, XAException.XAER_RMFAIL);
}
try (BlockingInvocation.Response response = invocation.getResponse()) {
try (MessageInputStream is = response.getInputStream()) {
Expand Down Expand Up @@ -305,7 +305,7 @@ public int prepare(final Xid xid, final ConnectionPeerIdentity peerIdentity) thr
throw Log.log.unrecognizedParameter(XAException.XAER_RMFAIL, id);
}
} catch (IOException e) {
throw Log.log.responseFailedXa(e, XAException.XAER_RMERR);
throw Log.log.responseFailedXa(e, XAException.XAER_RMFAIL);
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
Expand Down Expand Up @@ -363,7 +363,7 @@ public void forget(final Xid xid, final ConnectionPeerIdentity peerIdentity) thr
throw Log.log.unrecognizedParameter(XAException.XAER_RMFAIL, id);
}
} catch (IOException e) {
throw Log.log.responseFailedXa(e, XAException.XAER_RMERR);
throw Log.log.responseFailedXa(e, XAException.XAER_RMFAIL);
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
Expand Down Expand Up @@ -495,7 +495,7 @@ public Xid[] recover(final int flag, final String parentName, final ConnectionPe
Thread.currentThread().interrupt();
throw Log.log.interruptedXA(XAException.XAER_RMERR);
} catch (IOException e) {
throw Log.log.responseFailedXa(e, XAException.XAER_RMERR);
throw Log.log.responseFailedXa(e, XAException.XAER_RMFAIL);
}
}

Expand Down

0 comments on commit 6f97244

Please # to comment.