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():
- Open connection c1
- Do SQL with c1
- Call method bar()
- Do more SQLs with connection c1
- Close c1
Method bar():
- Open connection c2
- Do SQL with c2
- 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.

Add a comment