[
https://issues.apache.org/jira/browse/DBCP-415?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13969417#comment-13969417
]
Sebb commented on DBCP-415:
---------------------------
I think the PPS needs to be treated as the Statement to be finalised.
If it were a subclass of Statement rather than a wrapper (*), it would not make
sense to close the statement without closing the PPS - the statement is an
intrinsic part of the PPS.
So I agree that allowing the DelegatingStatement (DS) to finalise itself seems
wrong; only poolable object knows when it is no longer needed by the
application.
I think it might be useful to add some debugging to the various finalisers to
see how the DS finaliser can run if its PPS has not been finalised - if indeed
that is happening.
(*) this is an analogy, not a suggestion to change the code!
> Pooled PreparedStatements may be closed when accessed
> -----------------------------------------------------
>
> Key: DBCP-415
> URL: https://issues.apache.org/jira/browse/DBCP-415
> Project: Commons Dbcp
> Issue Type: Bug
> Affects Versions: 2.0
> Reporter: Phil Steitz
>
> Under high concurrency, connections using pooled PreparedStatements may
> encounter SQLExceptions with messages of the form
> "org.apache.commons.dbcp2.PoolablePreparedStatement with address: 'quoted
> SQL' is closed."
--
This message was sent by Atlassian JIRA
(v6.2#6252)