-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return value of enlistResource is ignored #32
Comments
My general advice would be not to mix XA connection work and a connection pool. |
tabish121
added a commit
that referenced
this issue
Nov 17, 2023
If the TXN manager does not enlist the XASession into the TXN then we should throw an error to indicate that the session could not enter the TXN and we need to ensure that on an error in enlistment or in registering the synchronization we return the session to the pool and properly reset the connection references so that session don't get trapped in the loaned state. This closes #32 (cherry picked from commit c79b2b3)
tabish121
added a commit
that referenced
this issue
Feb 15, 2024
If the TXN manager does not enlist the XASession into the TXN then we should throw an error to indicate that the session could not enter the TXN and we need to ensure that on an error in enlistment or in registering the synchronization we return the session to the pool and properly reset the connection references so that session don't get trapped in the loaned state. This closes #32 (cherry picked from commit c79b2b3) (cherry picked from commit 77cda3a)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the class org.messaginghub.pooled.jms.pool.PooledXAConnection, the method enlistResource of TransactionManager is invoked, but the return value of this method is ignored. The return value is a boolean; accoriding to the spec, it is true if the resource was enlisted, and false otherwise.
We are using the PooledXAConnection in combination with the Narayana transaction manager (org.jboss.narayana.jta:narayana-jta:5.12.7.Final). This implementation sometimes returns false for enlistResource if a resource is not available (in such a case, the transaction is marked as rollback-only). Since this return value is not checked, the processing continues despite the absence of a working transaction. In our case, this has lead to situations where messages could not be processed and were lost.
It would be good to check the return value of enlistResource, and perform appropriate actions if the return value is false.
Stack trace, in case it can be useful:
The text was updated successfully, but these errors were encountered: