You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by da...@apache.org on 2006/02/04 02:28:19 UTC

svn commit: r374809 - in /db/derby/code/trunk/java: client/org/apache/derby/client/am/SqlException.java client/org/apache/derby/client/am/SqlWarning.java testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/Stream.out

Author: davidvc
Date: Fri Feb  3 17:28:14 2006
New Revision: 374809

URL: http://svn.apache.org/viewcvs?rev=374809&view=rev
Log:
DERBY-922: Fix chaining of exceptions so the underlying client
SqlException/SqlWarning context is maintained and is available
for debugging.  

derbynetclientmats passes on JDK 1.4

Modified:
    db/derby/code/trunk/java/client/org/apache/derby/client/am/SqlException.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/SqlWarning.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/Stream.out

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/SqlException.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/am/SqlException.java?rev=374809&r1=374808&r2=374809&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/SqlException.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/SqlException.java Fri Feb  3 17:28:14 2006
@@ -281,10 +281,10 @@
             getErrorCode());
 
         // If we're in a runtime that supports chained exceptions, set the cause 
-        // of the SQLException.
+        // of the SQLException to be this SqlException.
          if (JVMInfo.JDK_ID >= JVMInfo.J2SE_14 )
         {
-            sqle.initCause(getCause());
+            sqle.initCause(this);
         }
 
         // Set up the nextException chain

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/SqlWarning.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/am/SqlWarning.java?rev=374809&r1=374808&r2=374809&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/SqlWarning.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/SqlWarning.java Fri Feb  3 17:28:14 2006
@@ -97,10 +97,10 @@
             getErrorCode());
 
         // If we're in a runtime that supports chained exceptions, set the cause 
-        // of the SQLException.
+        // of the SQLWarning to be this SqlWarning.
          if (JVMInfo.JDK_ID >= JVMInfo.J2SE_14 )
         {
-            sqlw.initCause(getCause());
+            sqlw.initCause(this);
         }
 
         // Set up the nextException chain

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/Stream.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/Stream.out?rev=374809&r1=374808&r2=374809&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/Stream.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/Stream.out Fri Feb  3 17:28:14 2006
@@ -2,15 +2,23 @@
 get stream from SMALL_BLOB_TABLE.SMALL_BLOB again ...
 Expected exception may happen.
 java.sql.SQLException: Stream of column value in result cannot be retrieved twice
+Caused by: org.apache.derby.client.am.SqlException: Stream of column value in result cannot be retrieved twice
+	... 4 more
 get stream from LARGE_BLOB_TABLE.LARGE_BLOB ...
 get stream from LARGE_BLOB_TABLE.LARGE_BLOB again ...
 Expected exception may happen.
 java.sql.SQLException: Stream of column value in result cannot be retrieved twice
+Caused by: org.apache.derby.client.am.SqlException: Stream of column value in result cannot be retrieved twice
+	... 4 more
 get reader from SMALL_CLOB_TABLE.SMALL_CLOB ...
 get reader from SMALL_CLOB_TABLE.SMALL_CLOBagain ...
 Expected exception may happen.
 java.sql.SQLException: Stream of column value in result cannot be retrieved twice
+Caused by: org.apache.derby.client.am.SqlException: Stream of column value in result cannot be retrieved twice
+	... 4 more
 get reader from LARGE_CLOB_TABLE.LARGE_CLOB ...
 get reader from LARGE_CLOB_TABLE.LARGE_CLOBagain ...
 Expected exception may happen.
 java.sql.SQLException: Stream of column value in result cannot be retrieved twice
+Caused by: org.apache.derby.client.am.SqlException: Stream of column value in result cannot be retrieved twice
+	... 4 more