You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2010/01/22 13:33:21 UTC
[jira] Created: (DBCP-322)
CPDSConnectionFactory.validateObject(Object) ignores Throwable
CPDSConnectionFactory.validateObject(Object) ignores Throwable
--------------------------------------------------------------
Key: DBCP-322
URL: https://issues.apache.org/jira/browse/DBCP-322
Project: Commons Dbcp
Issue Type: Bug
Reporter: Sebb
CPDSConnectionFactory.validateObject(Object) catches and ignores Throwable, which is a bit excessive. For example:
{code}
if (rset != null) {
try {
rset.close();
} catch (Throwable t) {
// ignore
}
}
{code}
close() can only throw SQLException, and that is all that should be ignored. In particular, ThreadDeath should never be ignored.
Same applies to KeyedCPDSConnectionFactory.
Basic[Managed]Datasource also catch Throwable, but rethrow it as SQLNestedException.
This is a bit better, but there's still the problem with ThreadDeath.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DBCP-322)
CPDSConnectionFactory.validateObject(Object) ignores Throwable
Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DBCP-322?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Phil Steitz updated DBCP-322:
-----------------------------
Affects Version/s: 1.2
1.2.1
1.2.2
1.3
1.4
Fix Version/s: 1.4.1
1.3.1
> CPDSConnectionFactory.validateObject(Object) ignores Throwable
> --------------------------------------------------------------
>
> Key: DBCP-322
> URL: https://issues.apache.org/jira/browse/DBCP-322
> Project: Commons Dbcp
> Issue Type: Bug
> Affects Versions: 1.2, 1.2.1, 1.2.2, 1.3, 1.4
> Reporter: Sebb
> Fix For: 1.3.1, 1.4.1
>
>
> CPDSConnectionFactory.validateObject(Object) catches and ignores Throwable, which is a bit excessive. For example:
> {code}
> if (rset != null) {
> try {
> rset.close();
> } catch (Throwable t) {
> // ignore
> }
> }
> {code}
> close() can only throw SQLException, and that is all that should be ignored. In particular, ThreadDeath should never be ignored.
> Same applies to KeyedCPDSConnectionFactory.
> Basic[Managed]Datasource also catch Throwable, but rethrow it as SQLNestedException.
> This is a bit better, but there's still the problem with ThreadDeath.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (DBCP-322)
CPDSConnectionFactory.validateObject(Object) ignores Throwable
Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DBCP-322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12803713#action_12803713 ]
Phil Steitz commented on DBCP-322:
----------------------------------
Agree this is excessive. Need to look carefully at each instance.
> CPDSConnectionFactory.validateObject(Object) ignores Throwable
> --------------------------------------------------------------
>
> Key: DBCP-322
> URL: https://issues.apache.org/jira/browse/DBCP-322
> Project: Commons Dbcp
> Issue Type: Bug
> Reporter: Sebb
>
> CPDSConnectionFactory.validateObject(Object) catches and ignores Throwable, which is a bit excessive. For example:
> {code}
> if (rset != null) {
> try {
> rset.close();
> } catch (Throwable t) {
> // ignore
> }
> }
> {code}
> close() can only throw SQLException, and that is all that should be ignored. In particular, ThreadDeath should never be ignored.
> Same applies to KeyedCPDSConnectionFactory.
> Basic[Managed]Datasource also catch Throwable, but rethrow it as SQLNestedException.
> This is a bit better, but there's still the problem with ThreadDeath.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.