diff --git a/pooled-jms/src/main/java/org/messaginghub/pooled/jms/pool/PooledXAConnection.java b/pooled-jms/src/main/java/org/messaginghub/pooled/jms/pool/PooledXAConnection.java index 6558041..78373b5 100644 --- a/pooled-jms/src/main/java/org/messaginghub/pooled/jms/pool/PooledXAConnection.java +++ b/pooled-jms/src/main/java/org/messaginghub/pooled/jms/pool/PooledXAConnection.java @@ -69,7 +69,9 @@ public Session createSession(boolean transacted, int ackMode) throws JMSExceptio session.setIsXa(true); transactionManager.getTransaction().registerSynchronization(new Synchronization(session)); incrementReferenceCount(); - transactionManager.getTransaction().enlistResource(createXaResource(session)); + if (!transactionManager.getTransaction().enlistResource(createXaResource(session))) { + throw new JMSException("Unable to enlist connection to existing transaction"); + } } else { session.setIgnoreClose(false); }