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-issue-importer opened this issue Aug 19, 2006 · 20 comments

Comments

@firebird-issue-importer

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-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Oct 18, 2007

Commented by: Roman Rokytskyy (rrokytskyy)

Could not reproduce yet...

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Oct 18, 2007

Modified by: Roman Rokytskyy (rrokytskyy)

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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 18, 2008

Modified by: Roman Rokytskyy (rrokytskyy)

Fix Version: Jaybird 2.1.6 [ 10285 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 19, 2008

Modified by: Roman Rokytskyy (rrokytskyy)

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

resolution: Cannot Reproduce [ 5 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 22, 2011

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-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 22, 2011

Modified by: @mrotteveel

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

resolution: Cannot Reproduce [ 5 ] =>

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 22, 2011

Modified by: @mrotteveel

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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 22, 2011

Modified by: @mrotteveel

Fix Version: Jaybird 2.2 [ 10053 ]

Fix Version: Jaybird 2.1.6 [ 10285 ] =>

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 22, 2011

Modified by: @mrotteveel

Link: This issue relate to JDBC131 [ JDBC131 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 22, 2011

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-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 22, 2011

Commented by: Ludovic Orban (lorban)

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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 23, 2011

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-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 23, 2011

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-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 30, 2011

Modified by: @mrotteveel

Link: This issue relate to JDBC176 [ JDBC176 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Aug 27, 2011

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-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Aug 27, 2011

Modified by: @mrotteveel

Fix Version: Jaybird 2.2 [ 10053 ] =>

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 17, 2011

Modified by: @mrotteveel

Fix Version: Jaybird 2.3 [ 10440 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 2, 2012

Commented by: @mrotteveel

Eliminated deprecated datasources from org.firebirdsql.pool

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 2, 2012

Modified by: @mrotteveel

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

resolution: Fixed [ 1 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 7, 2017

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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants