In a scenario of a JTA XA remote transaction we detect some connection leak when the transaction is rollbacked.
Let me explain the scenario running with Wildfly 17 server :
The leak doesn’t appear when the transaction is commited.
After some investigation we found that because of fix made for jira https://hibernate.atlassian.net/browse/HHH-7910#icft=HHH-7910 the class SynchronizationCallbackCoordinatorTrackingImpl is delaying the rollback of a JTA transaction if the rollback is made by a different thread.
However in our case the JTA XA Remote transaction is always commited or rollbacked in a different thread and the delay operation is never executed because there is no additionial job to do in the thread that retrieve the session.
We also found that this behavior of delaying the rollback can be desactivated using hibernate propery
“hibernate.jta.track_by_thread” set to “false”. But this has the side effect of reactivating the bug described in https://hibernate.atlassian.net/browse/HHH-7910#icft=HHH-7910
Does anyone know this issue ? Is there solution of “hibernate.jta.track_by_thread” set to “false” is safe in our scenario ?
Thanks in advance for your help