commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From di...@apache.org
Subject cvs commit: jakarta-commons/dbcp/src/java/org/apache/commons/dbcp BasicDataSource.java PoolableConnection.java PoolablePreparedStatement.java PoolingConnection.java PoolingDataSource.java
Date Mon, 11 Aug 2003 16:01:26 GMT
dirkv       2003/08/11 09:01:26

  Modified:    dbcp/src/java/org/apache/commons/dbcp BasicDataSource.java
                        PoolableConnection.java
                        PoolablePreparedStatement.java
                        PoolingConnection.java PoolingDataSource.java
  Log:
  use SQLNestedException for improved error messages
  
  Revision  Changes    Path
  1.16      +8 -8      jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/BasicDataSource.java
  
  Index: BasicDataSource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/BasicDataSource.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- BasicDataSource.java	11 Aug 2003 15:02:07 -0000	1.15
  +++ BasicDataSource.java	11 Aug 2003 16:01:25 -0000	1.16
  @@ -597,7 +597,7 @@
           } catch(RuntimeException e) {
               throw e;
           } catch(Exception e) {
  -            throw new SQLException(e.toString());
  +            throw new SQLNestedException("Cannot close connection pool", e);
           }
       }
   
  @@ -634,7 +634,7 @@
                   driverClassName + "'";
               logWriter.println(message);
               t.printStackTrace(logWriter);
  -            throw new SQLException(message);
  +            throw new SQLNestedException(message, t);
           }
   
           // Create a JDBC driver instance
  @@ -646,7 +646,7 @@
                   driverClassName + "' for connect URL '" + url + "'";
               logWriter.println(message);
               t.printStackTrace(logWriter);
  -            throw new SQLException(message);
  +            throw new SQLNestedException(message, t);
           }
   
           // Create an object pool to contain our active connections
  @@ -695,7 +695,7 @@
           } catch(RuntimeException e) {
               throw e;
           } catch(Exception e) {
  -            throw new SQLException(e.toString());
  +            throw new SQLNestedException("Cannot create PoolableConnectionFactory", e);
           }
   
           // Create and return the pooling data source to manage the connections
  
  
  
  1.8       +5 -5      jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/PoolableConnection.java
  
  Index: PoolableConnection.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/PoolableConnection.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- PoolableConnection.java	11 Aug 2003 12:21:47 -0000	1.7
  +++ PoolableConnection.java	11 Aug 2003 16:01:25 -0000	1.8
  @@ -117,7 +117,7 @@
               } catch(RuntimeException e) {
                   throw e;
               } catch(Exception e) {
  -                throw new SQLException(e.toString());
  +                throw new SQLNestedException("Cannot close connection (return to pool failed)",
e);
               }
           }
       }
  
  
  
  1.5       +5 -5      jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/PoolablePreparedStatement.java
  
  Index: PoolablePreparedStatement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/PoolablePreparedStatement.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PoolablePreparedStatement.java	1 Nov 2002 15:42:32 -0000	1.4
  +++ PoolablePreparedStatement.java	11 Aug 2003 16:01:25 -0000	1.5
  @@ -122,7 +122,7 @@
               } catch(RuntimeException e) {
                   throw e;
               } catch(Exception e) {
  -                throw new SQLException(e.toString());
  +                throw new SQLNestedException("Cannot close preparedstatement (return to
pool failed)", e);
               }
           }
       }
  
  
  
  1.6       +6 -6      jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/PoolingConnection.java
  
  Index: PoolingConnection.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/PoolingConnection.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PoolingConnection.java	11 Aug 2003 14:49:33 -0000	1.5
  +++ PoolingConnection.java	11 Aug 2003 16:01:25 -0000	1.6
  @@ -113,7 +113,7 @@
               } catch(SQLException e) {
                   throw e;
               } catch(Exception e) {
  -                throw new SQLException(e.toString());
  +                throw new SQLNestedException("Cannot close connection", e);
               }
           }
           getInnermostDelegate().close();
  @@ -129,7 +129,7 @@
           } catch(RuntimeException e) {
               throw e;
           } catch(Exception e) {
  -            throw new SQLException(e.toString());
  +            throw new SQLNestedException("Borrow prepareStatement from pool failed", e);
           }
       }
   
  @@ -143,7 +143,7 @@
           } catch(RuntimeException e) {
               throw e;
           } catch(Exception e) {
  -            throw new SQLException(e.toString());
  +            throw new SQLNestedException("Borrow prepareStatement from pool failed", e);
           }
       }
   
  
  
  
  1.5       +5 -7      jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/PoolingDataSource.java
  
  Index: PoolingDataSource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/PoolingDataSource.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PoolingDataSource.java	8 Nov 2002 19:17:23 -0000	1.4
  +++ PoolingDataSource.java	11 Aug 2003 16:01:25 -0000	1.5
  @@ -108,12 +108,10 @@
               return (Connection)(_pool.borrowObject());
           } catch(SQLException e) {
               throw e;
  -        } catch(NoSuchElementException e) {
  -            throw new SQLException(e.toString());
           } catch(RuntimeException e) {
               throw e;
           } catch(Exception e) {
  -            throw new SQLException(e.toString());
  +            throw new SQLNestedException("Cannot get a connection", e);
           }
       }
   
  
  
  

Mime
View raw message