commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1102284 - in /commons/proper/dbcp/trunk/src: changes/ java/org/apache/commons/dbcp2/ java/org/apache/commons/dbcp2/cpdsadapter/ java/org/apache/commons/dbcp2/datasources/ test/org/apache/commons/dbcp2/
Date Thu, 12 May 2011 13:19:29 GMT
Author: markt
Date: Thu May 12 13:19:28 2011
New Revision: 1102284

URL: http://svn.apache.org/viewvc?rev=1102284&view=rev
Log:
Remove SQLNestedException

Removed:
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/SQLNestedException.java
Modified:
    commons/proper/dbcp/trunk/src/changes/changes.xml
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/BasicDataSource.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolableCallableStatement.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolablePreparedStatement.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolingConnection.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolingDataSource.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PooledConnectionImpl.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSource.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/PerUserPoolDataSource.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/SharedPoolDataSource.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolingDriver.java

Modified: commons/proper/dbcp/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/changes/changes.xml?rev=1102284&r1=1102283&r2=1102284&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/changes/changes.xml (original)
+++ commons/proper/dbcp/trunk/src/changes/changes.xml Thu May 12 13:19:28 2011
@@ -65,6 +65,9 @@ The <action> type attribute can be add,u
       <action dev="markt" type="update">
         Removed JOCL support.
       </action>
+      <action dev=markt type="update">
+        Remove deprecated SQLNestedException. 
+      </action>
     <release version="1.4.1" date="TBD" description="TBD">
       <action dev="psteitz" issue="DBCP-334" type="update" due-to="Alberto Mozzone">
         Exposed GenericObjectPool's softMinEvictableIdleTimeMillis property for

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/BasicDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/BasicDataSource.java?rev=1102284&r1=1102283&r2=1102284&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/BasicDataSource.java (original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/BasicDataSource.java Thu May
12 13:19:28 2011
@@ -1472,7 +1472,7 @@ public class BasicDataSource implements 
         } catch(RuntimeException e) {
             throw e;
         } catch(Exception e) {
-            throw new SQLNestedException("Cannot close connection pool", e);
+            throw new SQLException("Cannot close connection pool", e);
         }
     }
 
@@ -1582,7 +1582,7 @@ public class BasicDataSource implements 
                 }
             } catch (Exception e) {
                 closeConnectionPool();
-                throw new SQLNestedException("Error preloading the connection pool", e);
+                throw new SQLException("Error preloading the connection pool", e);
             }
             
             // If timeBetweenEvictionRunsMillis > 0, start the pool's evictor task
@@ -1630,7 +1630,7 @@ public class BasicDataSource implements 
                     driverClassName + "'";
                 logWriter.println(message);
                 t.printStackTrace(logWriter);
-                throw new SQLNestedException(message, t);
+                throw new SQLException(message, t);
             }
         }
 
@@ -1653,7 +1653,7 @@ public class BasicDataSource implements 
                 "' for connect URL '" + url + "'";
             logWriter.println(message);
             t.printStackTrace(logWriter);
-            throw new SQLNestedException(message, t);
+            throw new SQLException(message, t);
         }
 
         // Can't test without a validationQuery
@@ -1782,7 +1782,7 @@ public class BasicDataSource implements 
         } catch (RuntimeException e) {
             throw e;
         } catch (Exception e) {
-            throw new SQLNestedException("Cannot create PoolableConnectionFactory (" + e.getMessage()
+ ")", e);
+            throw new SQLException("Cannot create PoolableConnectionFactory (" + e.getMessage()
+ ")", e);
         }
     }
 

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolableCallableStatement.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolableCallableStatement.java?rev=1102284&r1=1102283&r2=1102284&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolableCallableStatement.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolableCallableStatement.java
Thu May 12 13:19:28 2011
@@ -81,7 +81,7 @@ public class PoolableCallableStatement e
             } catch(RuntimeException e) {
                 throw e;
             } catch(Exception e) {
-                throw new SQLNestedException("Cannot close CallableStatement (return to pool
failed)", e);
+                throw new SQLException("Cannot close CallableStatement (return to pool failed)",
e);
             }
         }
     }

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolablePreparedStatement.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolablePreparedStatement.java?rev=1102284&r1=1102283&r2=1102284&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolablePreparedStatement.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolablePreparedStatement.java
Thu May 12 13:19:28 2011
@@ -102,7 +102,7 @@ public class PoolablePreparedStatement e
             } catch(RuntimeException e) {
                 throw e;
             } catch(Exception e) {
-                throw new SQLNestedException("Cannot close preparedstatement (return to pool
failed)", e);
+                throw new SQLException("Cannot close preparedstatement (return to pool failed)",
e);
             }
         }
     }

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolingConnection.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolingConnection.java?rev=1102284&r1=1102283&r2=1102284&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolingConnection.java (original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolingConnection.java Thu
May 12 13:19:28 2011
@@ -112,7 +112,7 @@ public class PoolingConnection extends D
         } catch(RuntimeException e) {
             throw e;
         } catch(Exception e) {
-            throw new SQLNestedException("Borrow prepareStatement from pool failed", e);
+            throw new SQLException("Borrow prepareStatement from pool failed", e);
         }
     }
 
@@ -152,11 +152,11 @@ public class PoolingConnection extends D
         try {
             return (CallableStatement) (_pstmtPool.borrowObject(createKey(sql, STATEMENT_CALLABLESTMT)));
         } catch (NoSuchElementException e) {
-            throw new SQLNestedException("MaxOpenCallableStatements limit reached", e);
+            throw new SQLException("MaxOpenCallableStatements limit reached", e);
         } catch (RuntimeException e) {
             throw e;
         } catch (Exception e) {
-            throw new SQLNestedException("Borrow callableStatement from pool failed", e);
+            throw new SQLException("Borrow callableStatement from pool failed", e);
         }
     }
     
@@ -175,11 +175,11 @@ public class PoolingConnection extends D
             return (CallableStatement) (_pstmtPool.borrowObject(createKey(sql, resultSetType,
                             resultSetConcurrency, STATEMENT_CALLABLESTMT)));
         } catch (NoSuchElementException e) {
-            throw new SQLNestedException("MaxOpenCallableStatements limit reached", e);
+            throw new SQLException("MaxOpenCallableStatements limit reached", e);
         } catch (RuntimeException e) {
             throw e;
         } catch (Exception e) {
-            throw new SQLNestedException("Borrow callableStatement from pool failed", e);
+            throw new SQLException("Borrow callableStatement from pool failed", e);
         }
     }
     

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolingDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolingDataSource.java?rev=1102284&r1=1102283&r2=1102284&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolingDataSource.java (original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PoolingDataSource.java Thu
May 12 13:19:28 2011
@@ -114,11 +114,11 @@ public class PoolingDataSource implement
         } catch(SQLException e) {
             throw e;
         } catch(NoSuchElementException e) {
-            throw new SQLNestedException("Cannot get a connection, pool error " + e.getMessage(),
e);
+            throw new SQLException("Cannot get a connection, pool error " + e.getMessage(),
e);
         } catch(RuntimeException e) {
             throw e;
         } catch(Exception e) {
-            throw new SQLNestedException("Cannot get a connection, general error", e);
+            throw new SQLException("Cannot get a connection, general error", e);
         }
     }
 

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PooledConnectionImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PooledConnectionImpl.java?rev=1102284&r1=1102283&r2=1102284&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PooledConnectionImpl.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PooledConnectionImpl.java
Thu May 12 13:19:28 2011
@@ -32,7 +32,6 @@ import javax.sql.StatementEventListener;
 
 import org.apache.commons.dbcp2.DelegatingConnection;
 import org.apache.commons.dbcp2.DelegatingPreparedStatement;
-import org.apache.commons.dbcp2.SQLNestedException;
 import org.apache.commons.pool2.KeyedObjectPool;
 import org.apache.commons.pool2.KeyedPoolableObjectFactory;
 
@@ -148,7 +147,7 @@ class PooledConnectionImpl 
         } catch (RuntimeException e) {
             throw e;
         } catch (Exception e) {
-            throw new SQLNestedException("Cannot close connection (return to pool failed)",
e);
+            throw new SQLException("Cannot close connection (return to pool failed)", e);
         } finally {
             try {
                 connection.close();
@@ -255,7 +254,7 @@ class PooledConnectionImpl 
             } catch (RuntimeException e) {
                 throw e;
             } catch (Exception e) {
-                throw new SQLNestedException("Borrow prepareStatement from pool failed",
e);
+                throw new SQLException("Borrow prepareStatement from pool failed", e);
             }
         }
     }
@@ -288,7 +287,7 @@ class PooledConnectionImpl 
             } catch (RuntimeException e) {
                 throw e;
             } catch (Exception e) {
-                throw new SQLNestedException("Borrow prepareStatement from pool failed",
e);
+                throw new SQLException("Borrow prepareStatement from pool failed", e);
             }
         }
     }
@@ -315,7 +314,7 @@ class PooledConnectionImpl 
             } catch (RuntimeException e) {
                 throw e;
             } catch (Exception e) {
-                throw new SQLNestedException("Borrow prepareStatement from pool failed",
e);
+                throw new SQLException("Borrow prepareStatement from pool failed", e);
             }
         }
     }
@@ -334,7 +333,7 @@ class PooledConnectionImpl 
             } catch (RuntimeException e) {
                 throw e;
             } catch (Exception e) {
-                throw new SQLNestedException("Borrow prepareStatement from pool failed",
e);
+                throw new SQLException("Borrow prepareStatement from pool failed", e);
             }
         }
     }
@@ -350,7 +349,7 @@ class PooledConnectionImpl 
             } catch (RuntimeException e) {
                 throw e;
             } catch (Exception e) {
-                throw new SQLNestedException("Borrow prepareStatement from pool failed",
e);
+                throw new SQLException("Borrow prepareStatement from pool failed", e);
             }
         }
     }
@@ -366,7 +365,7 @@ class PooledConnectionImpl 
             } catch (RuntimeException e) {
                 throw e;
             } catch (Exception e) {
-                throw new SQLNestedException("Borrow prepareStatement from pool failed",
e);
+                throw new SQLException("Borrow prepareStatement from pool failed", e);
             }
         }
     }

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSource.java?rev=1102284&r1=1102283&r2=1102284&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSource.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSource.java
Thu May 12 13:19:28 2011
@@ -34,7 +34,6 @@ import javax.sql.ConnectionPoolDataSourc
 import javax.sql.DataSource;
 import javax.sql.PooledConnection;
 
-import org.apache.commons.dbcp2.SQLNestedException;
 import org.apache.commons.pool2.impl.GenericObjectPool;
 import org.apache.commons.pool2.impl.WhenExhaustedAction;
 
@@ -710,7 +709,7 @@ public abstract class InstanceKeyDataSou
             info = getPooledConnectionAndInfo(username, password);
         } catch (NoSuchElementException e) {
             closeDueToException(info);
-            throw new SQLNestedException("Cannot borrow connection from pool", e);
+            throw new SQLException("Cannot borrow connection from pool", e);
         } catch (RuntimeException e) {
             closeDueToException(info);
             throw e;
@@ -719,7 +718,7 @@ public abstract class InstanceKeyDataSou
             throw e;
         } catch (Exception e) {
             closeDueToException(info);
-            throw new SQLNestedException("Cannot borrow connection from pool", e);
+            throw new SQLException("Cannot borrow connection from pool", e);
         }
         
         if (!(null == password ? null == info.getPassword() 
@@ -749,7 +748,7 @@ public abstract class InstanceKeyDataSou
                     info = getPooledConnectionAndInfo(username, password);
                 } catch (NoSuchElementException e) {
                     closeDueToException(info);
-                    throw new SQLNestedException("Cannot borrow connection from pool", e);
+                    throw new SQLException("Cannot borrow connection from pool", e);
                 } catch (RuntimeException e) {
                     closeDueToException(info);
                     throw e;
@@ -758,7 +757,7 @@ public abstract class InstanceKeyDataSou
                     throw e;
                 } catch (Exception e) {
                     closeDueToException(info);
-                    throw new SQLNestedException("Cannot borrow connection from pool", e);
+                    throw new SQLException("Cannot borrow connection from pool", e);
                 }
                 if (info != null && password.equals(info.getPassword())) {
                     break;

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/PerUserPoolDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/PerUserPoolDataSource.java?rev=1102284&r1=1102283&r2=1102284&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/PerUserPoolDataSource.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/PerUserPoolDataSource.java
Thu May 12 13:19:28 2011
@@ -31,8 +31,6 @@ import javax.naming.Reference;
 import javax.naming.StringRefAddr;
 import javax.sql.ConnectionPoolDataSource;
 
-import org.apache.commons.dbcp2.SQLNestedException;
-
 import org.apache.commons.pool2.ObjectPool;
 import org.apache.commons.pool2.impl.GenericObjectPool;
 
@@ -384,7 +382,7 @@ public class PerUserPoolDataSource
                     registerPool(username, password);
                     manager = (PooledConnectionManager) managers.get(key);
                 } catch (NamingException e) {
-                    throw new SQLNestedException("RegisterPool failed", e);
+                    throw new SQLException("RegisterPool failed", e);
                 }
             }
             pool = ((CPDSConnectionFactory) manager).getPool();
@@ -395,7 +393,7 @@ public class PerUserPoolDataSource
             info = (PooledConnectionAndInfo) pool.borrowObject();
         }
         catch (NoSuchElementException ex) {
-            throw new SQLNestedException(
+            throw new SQLException(
                     "Could not retrieve connection info from pool", ex);
         }
         catch (Exception e) {
@@ -415,7 +413,7 @@ public class PerUserPoolDataSource
                 registerPool(username, password);
                 pool = getPool(key);
             } catch (NamingException ne) {
-                throw new SQLNestedException("RegisterPool failed", ne);
+                throw new SQLException("RegisterPool failed", ne);
             }
             try {
                 info = (PooledConnectionAndInfo)pool.borrowObject();

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/SharedPoolDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/SharedPoolDataSource.java?rev=1102284&r1=1102283&r2=1102284&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/SharedPoolDataSource.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/datasources/SharedPoolDataSource.java
Thu May 12 13:19:28 2011
@@ -30,7 +30,6 @@ import javax.sql.ConnectionPoolDataSourc
 import org.apache.commons.pool2.KeyedObjectPool;
 import org.apache.commons.pool2.impl.GenericKeyedObjectPool;
 import org.apache.commons.pool2.impl.GenericObjectPool;
-import org.apache.commons.dbcp2.SQLNestedException;
 
 /**
  * <p>A pooling <code>DataSource</code> appropriate for deployment within
@@ -170,7 +169,7 @@ public class SharedPoolDataSource
                 try {
                     registerPool(username, password);
                 } catch (NamingException e) {
-                    throw new SQLNestedException("RegisterPool failed", e);
+                    throw new SQLException("RegisterPool failed", e);
                 }
             }
         }
@@ -183,7 +182,7 @@ public class SharedPoolDataSource
             info = (PooledConnectionAndInfo) pool.borrowObject(key);
         }
         catch (Exception e) {
-            throw new SQLNestedException(
+            throw new SQLException(
                     "Could not retrieve connection info from pool", e);
         }
         return info;

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolingDriver.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolingDriver.java?rev=1102284&r1=1102283&r2=1102284&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolingDriver.java (original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolingDriver.java Thu
May 12 13:19:28 2011
@@ -186,37 +186,37 @@ public class TestPoolingDriver extends T
         SQLException ex;
         
         DriverManager.setLogWriter(pw);
-        ex = new SQLNestedException("A", new Exception("a"));
+        ex = new SQLException("A", new Exception("a"));
         ex.printStackTrace();
         ex.printStackTrace(ps);
         ex.printStackTrace(pw);
-        ex = new SQLNestedException("B", null);
+        ex = new SQLException("B");
         ex.printStackTrace();
         ex.printStackTrace(ps);
         ex.printStackTrace(pw);
-        ex = new SQLNestedException(null, new Exception("c"));
+        ex = new SQLException(null, new Exception("c"));
         ex.printStackTrace();
         ex.printStackTrace(ps);
         ex.printStackTrace(pw);
-        ex = new SQLNestedException(null, null);
+        ex = new SQLException((String)null);
         ex.printStackTrace();
         ex.printStackTrace(ps);
         ex.printStackTrace(pw);
 
         DriverManager.setLogWriter(null);
-        ex = new SQLNestedException("A", new Exception("a"));
+        ex = new SQLException("A", new Exception("a"));
         ex.printStackTrace();
         ex.printStackTrace(ps);
         ex.printStackTrace(pw);
-        ex = new SQLNestedException("B", null);
+        ex = new SQLException("B");
         ex.printStackTrace();
         ex.printStackTrace(ps);
         ex.printStackTrace(pw);
-        ex = new SQLNestedException(null, new Exception("c"));
+        ex = new SQLException(null, new Exception("c"));
         ex.printStackTrace();
         ex.printStackTrace(ps);
         ex.printStackTrace(pw);
-        ex = new SQLNestedException(null, null);
+        ex = new SQLException((String)null);
         ex.printStackTrace();
         ex.printStackTrace(ps);
         ex.printStackTrace(pw);



Mime
View raw message