commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (DBCP-313) PooledConnection.removeConnectionEventListener(ConnectionEventListener) does not throw any Exceptions, yet DBCP protects calls to it
Date Tue, 05 Jan 2010 03:06:54 GMT

     [ https://issues.apache.org/jira/browse/DBCP-313?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sebb resolved DBCP-313.
-----------------------

    Resolution: Fixed

URL: http://svn.apache.org/viewvc?rev=895869&view=rev
Log:
DBCP-313 Remove code that catches and ignores Exceptions when calling
PooledConnection.removeConnectionEventListener(ConnectionEventListener)
as the method does not throw any Exceptions.

> PooledConnection.removeConnectionEventListener(ConnectionEventListener) does not throw
any Exceptions, yet DBCP protects calls to it
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DBCP-313
>                 URL: https://issues.apache.org/jira/browse/DBCP-313
>             Project: Commons Dbcp
>          Issue Type: Bug
>            Reporter: Sebb
>
> javax.sql.PooledConnection.removeConnectionEventListener(ConnectionEventListener) does
not throw any Exceptions, yet DBCP protects calls to it, generally ignoring any Exception.
> For example, in datasources.CPDSConnectionFactory:
> {code}
> public void destroyObject(Object obj) throws Exception {
>     if (obj instanceof PooledConnectionAndInfo) {
>         PooledConnection pc = ((PooledConnectionAndInfo)obj).getPooledConnection();
>         try {
>             pc.removeConnectionEventListener(this);
>         } catch (Exception e) {
>             //ignore
>         }
> ....
> {code}
> This seems wrong, as the code may accidentally swallow a genuine Exception.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message