Bug190537
Allow SessionHandleState reuse after closing a pooled connection with recycleActiveConnectionsInTransaction=true

Severity:4
Affected version(s):5.0.104

Description

When setting recycleActiveConnectionsInTransaction=true, you can now reuse connections more flexibly.

Technical details

Consider the following use case with recycleActiveConnectionsInTransaction enabled:

Method foo():

  1. Open connection c1
  2. Do SQL with c1
  3. Call method bar()
  4. Do more SQLs with connection c1
  5. Close c1

Method bar():

  1. Open connection c2
  2. Do SQL with c2
  3. Close c2

With recycleActiveConnectionsInTransaction=true, c1 will be the same connection instance as c2.

So after method bar() closes c2, c1 will also be closed and this caused errors like these in step 4 of method foo():

The underlying XA session is closed
                at com.atomikos.jdbc.internal.AtomikosSQLException.throwAtomikosSQLException(AtomikosSQLException.java:29)
                at com.atomikos.jdbc.internal.AtomikosJdbcConnectionProxy.enlist(AtomikosJdbcConnectionProxy.java:108)
                at com.atomikos.jdbc.internal.AtomikosJdbcConnectionProxy.updateTransactionContext(AtomikosJdbcConnectionProxy.java:61)
                at com.atomikos.jdbc.internal.AbstractJdbcConnectionProxy.prepareStatement(AbstractJdbcConnectionProxy.java:64)
                at sun.reflect.GeneratedMethodAccessor228.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(Method.java:498)
                at com.atomikos.util.DynamicProxySupport.callProxiedMethod(DynamicProxySupport.java:162)
                at com.atomikos.util.DynamicProxySupport.invoke(DynamicProxySupport.java:116)
                at com.sun.proxy.$Proxy801.prepareStatement(Unknown Source)

Changes impacting client API

None.

About Severity

The severity levels we use are defined in our support terms and conditions.

Available to customers only. Want to become a customer?

Free Trial

Add a comment

Corporate Information

Atomikos Corporate Headquarters
Hoveniersstraat, 39/1, 2800
Mechelen, Belgium

Contact Us

Copyright 2026 Atomikos BVBA | Our Privacy Policy
By using this site you agree to our cookies. More info. That's Fine