Skip to content
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

Closed
firebird-automations opened this issue Aug 19, 2006 · 20 comments

Comments

@firebird-automations
Copy link

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

@firebird-automations
Copy link
Author

Commented by: Roman Rokytskyy (rrokytskyy)

Could not reproduce yet...

@firebird-automations
Copy link
Author

Modified by: Roman Rokytskyy (rrokytskyy)

priority: Major [ 3 ] => Minor [ 4 ]

@firebird-automations
Copy link
Author

Modified by: Roman Rokytskyy (rrokytskyy)

Fix Version: Jaybird 2.1.6 [ 10285 ]

@firebird-automations
Copy link
Author

Modified by: Roman Rokytskyy (rrokytskyy)

status: Open [ 1 ] => Closed [ 6 ]

resolution: Cannot Reproduce [ 5 ]

@firebird-automations
Copy link
Author

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

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

status: Closed [ 6 ] => Reopened [ 4 ]

resolution: Cannot Reproduce [ 5 ] =>

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

assignee: Roman Rokytskyy [ rrokytskyy ] => Mark Rotteveel [ avalanche1979 ]

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

Fix Version: Jaybird 2.2 [ 10053 ]

Fix Version: Jaybird 2.1.6 [ 10285 ] =>

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

Link: This issue relate to JDBC131 [ JDBC131 ]

@firebird-automations
Copy link
Author

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.

@firebird-automations
Copy link
Author

Commented by: Ludovic Orban (lorban)

Please keep in mind that XAConnection's returned by XADataSource should not be pooled.

@firebird-automations
Copy link
Author

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.

@firebird-automations
Copy link
Author

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.

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

Link: This issue relate to JDBC176 [ JDBC176 ]

@firebird-automations
Copy link
Author

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

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

Fix Version: Jaybird 2.2 [ 10053 ] =>

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

Fix Version: Jaybird 2.3 [ 10440 ]

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

Eliminated deprecated datasources from org.firebirdsql.pool

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

status: Reopened [ 4 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants