You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Phil Steitz (JIRA)" <ji...@apache.org> on 2006/07/09 22:46:30 UTC

[jira] Updated: (DBCP-154) [dbcp] PoolableConnectionFactory.validateConnection() should log exception message

     [ http://issues.apache.org/jira/browse/DBCP-154?page=all ]

Phil Steitz updated DBCP-154:
-----------------------------

    Bugzilla Id:   (was: 24718)
    Fix Version: 1.3

Include in logging refactoring.

> [dbcp] PoolableConnectionFactory.validateConnection() should log exception message
> ----------------------------------------------------------------------------------
>
>          Key: DBCP-154
>          URL: http://issues.apache.org/jira/browse/DBCP-154
>      Project: Commons Dbcp
>         Type: Improvement

>     Versions: 1.0 Alpha
>  Environment: Operating System: other
> Platform: All
>     Reporter: Noah Levitt
>     Priority: Minor
>      Fix For: 1.3

>
> Since PoolableConnectionFactory.validateObject() doesn't pass up the exception
> from validateConnect(), the latter needs to log it somehow. Otherwise the user
> of the library only knows that there was a problem retrieving a connection. To
> fix the problem they will doubtless need to know the error being reported by the
> database. The following patch is probably not good to apply, but it gives an
> idea of what I think should be logged.
> Index: src/java/org/apache/commons/dbcp/PoolableConnectionFactory.java
> ===================================================================
> RCS file:
> /home/cvspublic/jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/PoolableConnectionFactory.java,v
> retrieving revision 1.15
> diff -u -p -u -r1.15 PoolableConnectionFactory.java
> --- src/java/org/apache/commons/dbcp/PoolableConnectionFactory.java     9 Oct
> 2003 21:04:44 -0000       1.15
> +++ src/java/org/apache/commons/dbcp/PoolableConnectionFactory.java     14 Nov
> 2003 22:48:31 -0000
> @@ -339,6 +339,8 @@ public class PoolableConnectionFactory i
>                  if(!rset.next()) {
>                      throw new SQLException("validationQuery didn't return a row");
>                  }
> +            } catch (Exception e) {
> +               
> System.err.println("PoolableConnectionFactory.validationConnection: connection
> validation with query \"" + query + "\" failed: " + e);
>              } finally {
>                  try {
>                      rset.close();

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org