From 79d70e0c2c18fe5a01dd9688c9b777a77ef51164 Mon Sep 17 00:00:00 2001 From: Emmanuel Hugonnet Date: Fri, 22 Mar 2024 09:29:17 +0100 Subject: [PATCH] Fixing ARTEMIS-4652 using Mirek's idea on not closing connection on XAER_NOTA. Signed-off-by: Emmanuel Hugonnet --- .../extensions/xa/recovery/ActiveMQXAResourceWrapper.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/xa/recovery/ActiveMQXAResourceWrapper.java b/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/xa/recovery/ActiveMQXAResourceWrapper.java index 219ec8c43395..25cdbcc958f2 100644 --- a/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/xa/recovery/ActiveMQXAResourceWrapper.java +++ b/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/xa/recovery/ActiveMQXAResourceWrapper.java @@ -399,9 +399,10 @@ public void close() { */ protected XAException check(final XAException e) throws XAException { ActiveMQXARecoveryLogger.LOGGER.xaRecoveryError(e); - - // If any exception happened, we close the connection so we may start fresh - close(); + if (e.errorCode != XAException.XAER_NOTA) { + // If any exception happened, we close the connection so we may start fresh + close(); + } throw e; }