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
Regression: FBConnectionPoolDataSource throws FBSQLException when connections are re-used [JDBC86] #125
Comments
Commented by: Roman Rokytskyy (rrokytskyy) Could not reproduce yet... |
Modified by: Roman Rokytskyy (rrokytskyy)priority: Major [ 3 ] => Minor [ 4 ] |
Modified by: Roman Rokytskyy (rrokytskyy)Fix Version: Jaybird 2.1.6 [ 10285 ] |
Modified by: Roman Rokytskyy (rrokytskyy)status: Open [ 1 ] => Closed [ 6 ] resolution: Cannot Reproduce [ 5 ] |
Commented by: @mrotteveel Able to reproduce this with a client similar to the one in JDBC93. I get either the error in this issue, or the error in JDBC144 |
Modified by: @mrotteveelstatus: Closed [ 6 ] => Reopened [ 4 ] resolution: Cannot Reproduce [ 5 ] => |
Modified by: @mrotteveelassignee: Roman Rokytskyy [ rrokytskyy ] => Mark Rotteveel [ avalanche1979 ] |
Modified by: @mrotteveel |
Commented by: @mrotteveel Problem is that FBConnectionPoolDataSource and related implementations are also connection pools themselves. The implementation of the resource handling returns PooledConnections to the internal pool when the logical Connection created from the PooledConnections is closed. This causes the error as the Jaybird connection pool thinks the PooledConnection has been returned to the pool, while in reality the PooledConnection is still owned by the AS. I am still looking at the current implementation to see what needs to be done to fix this. |
Commented by: Ludovic Orban (lorban) Please keep in mind that XAConnection's returned by XADataSource should not be pooled. |
Commented by: @mrotteveel The XAConnection itself shouldn't be pooled but the underlying physical connection is allowed to be pooled. The problem is mainly with the way the closure of the logical connection (delivered to the client) is handled. |
Commented by: Ludovic Orban (lorban) Pooling is supposed to be done at a higher level, not at a lower one. Check the javax.sql.PooledConnection javadoc which javax.sql.XADataSource extends: http://download.oracle.com/javase/1.4.2/docs/api/javax/sql/PooledConnection.html The JDBC driver is not supposed to pool the Connection objects returned by XAConnection.getConnection(), those are physical connections and it's up to the connection pool to decide when to recycle the physical connections or close them. This is exactly what I tried implementing in org.firebirdsql.jca.FBXADataSource but I never found the time to properly test the code. |
Modified by: @mrotteveel |
Commented by: @mrotteveel Removed Fix version; for Jaybird 2.2 use org.firebirdsql.ds.FBConnectionPoolDataSource instead. This class is considered for removal in Jaybird version after 2.2 |
Modified by: @mrotteveelFix Version: Jaybird 2.2 [ 10053 ] => |
Modified by: @mrotteveelFix Version: Jaybird 2.3 [ 10440 ] |
Commented by: @mrotteveel Eliminated deprecated datasources from org.firebirdsql.pool |
Modified by: @mrotteveelstatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: Ludovic Orban (lorban)
Relate to JDBC131
Relate to JDBC176
You sporadically get this exception when you call XAConnection.getConnection() on XAConnection obtained from FBConnectionPoolDataSource:
org.firebirdsql.jdbc.FBSQLException: Physical connection is currently in pool, you cannot allocate logical connections now.
at org.firebirdsql.pool.PingablePooledConnection.checkInPool(PingablePooledConnection.java:225)
at org.firebirdsql.pool.PingablePooledConnection.getConnection(PingablePooledConnection.java:341)
...
I could not trace down what exactly causes this exception to be thrown but it seems to happen when a connection from the pool is being reused, ie: when it has already been closed once and is being taken by the pool due to a call to open().
Commits: 82c7f08 e95cc1d 7c162c8
The text was updated successfully, but these errors were encountered: