Shaktisinh Jhala created DBCP-594:
-------------------------------------
Summary: DBCP Does not check the validity of pooled connection at
the time creating preparedStatement
Key: DBCP-594
URL: https://issues.apache.org/jira/browse/DBCP-594
Project: Commons DBCP
Issue Type: Bug
Affects Versions: 2.9.0
Environment: OS: CentOS
DB: PostgreSQL
Java: openjdk 17.0.8.1 2023-08-24
Reporter: Shaktisinh Jhala
Attachments: ExceptionStackTrace.txt
Recently we observed an issue of "This connection has been closed." while
borrowing prepared statement from the pool.
It was trying to create a new PreparedStatement using the pooled connection
object. And the Pooled connection object was already closed due to some reason.
There are two configurations testOnBorrow and testOnCreated which ensures that
the connection being created is valid at the time of issuing it and after
creating it.
But the validation check on the connection is not performed before using the
connection for creating prepared statement which results into this problem.
Attached is the exception stack trace for this issue.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)