Bug 64083 - JDBC pool keeps closed connection as available
Summary: JDBC pool keeps closed connection as available
Status: NEW
Alias: None
Product: Tomcat Modules
Classification: Unclassified
Component: jdbc-pool (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-17 16:53 UTC by Alex Panchenko
Modified: 2020-01-17 16:58 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Panchenko 2020-01-17 16:53:01 UTC
In my case the PG driver has closed connecction because of kind of I/O error - an attempt to pass too many parameters for PreparedStatement.

I've created an example: https://github.com/panchenko/tomcat-bugs/blob/master/jdbc-return-closed-connection/src/test/java/org/example/jdbc/ReturnClosedConnectionTest.java

However that closed connection was added to the avaiable ones in the ppol (despite an error during clearWarnings, etc).

And then some other code got that closed connection and failed.

The pool request: https://github.com/apache/tomcat/pull/235