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 ka...@apache.org on 2006/10/31 09:28:27 UTC

svn commit: r469410 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/jdbc/ testing/org/apache/derbyTesting/functionTests/master/jdk16/

Author: kahatlen
Date: Tue Oct 31 00:28:26 2006
New Revision: 469410

URL: http://svn.apache.org/viewvc?view=rev&rev=469410
Log:
DERBY-1991: Misleading stack traces for exceptions raised by the JDBC
4.0 embedded driver

Don't set the stack trace of the SQLException to the stack trace of
the dummy exception in SQLExceptionFactory40.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/SQLExceptionFactory40.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/jdk16/closed.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/jdk16/releaseCompileLocks.out

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/SQLExceptionFactory40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/SQLExceptionFactory40.java?view=diff&rev=469410&r1=469409&r2=469410
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/SQLExceptionFactory40.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/SQLExceptionFactory40.java Tue Oct 31 00:28:26 2006
@@ -49,8 +49,6 @@
      * 40                          java.sql.SQLTransactionRollbackException
      * 42                          java.sql.SQLSyntaxErrorException
      * 
-     * This method sets the stack trace of the newly created exception to the
-     * root cause of the original Throwable.
      * Note the following divergence from JDBC3 behavior: When running
      * a JDBC3 client, we return EmbedSQLException. That exception class
      * overrides Throwable.toString() and strips off the Throwable's class name.
@@ -71,7 +69,7 @@
 		//
 		t = wrapArgsForTransportAcrossDRDA( message, messageId, next, severity, t, args );
 
-		SQLException ex = new SQLException(message, sqlState, severity, t);
+        final SQLException ex;
         if (sqlState.startsWith(SQLState.CONNECTIVITY_PREFIX)) {
             //none of the sqlstate supported by derby belongs to
             //NonTransientConnectionException
@@ -93,13 +91,12 @@
             ex = new SQLSyntaxErrorException(message, sqlState, severity, t);
         } else if (sqlState.startsWith(SQLState.UNSUPPORTED_PREFIX)) {
             ex = new SQLFeatureNotSupportedException(message, sqlState, severity, t);
+        } else {
+            ex = new SQLException(message, sqlState, severity, t);
         }
         
         if (next != null) {
             ex.setNextException(next);
-        }
-        if (t != null) {
-            ex.setStackTrace (t.getStackTrace ());
         }
         return ex;
     }        

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/jdk16/closed.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/jdk16/closed.out?view=diff&rev=469410&r1=469409&r2=469410
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/jdk16/closed.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/jdk16/closed.out Tue Oct 31 00:28:26 2006
@@ -14,7 +14,7 @@
 Test database shutdown ...
 java.sql.SQLException: Database 'wombat' shutdown.
 Caused by: java.sql.SQLException: Database 'wombat' shutdown.
-	... 13 more
+	... 10 more
 CALL sleep(10000) - 38000, 38000 -- InterruptedException, XJ001 -- InterruptedException
 LOCK TABLE CLOSED.LOCKME IN EXCLUSIVE MODE - 08006, 08006 -- Database 'wombat' shutdown.
 ERROR 08006: Database 'wombat' shutdown.
@@ -22,7 +22,7 @@
 Test system shutdown ...
 java.sql.SQLException: Database 'wombat' shutdown.
 Caused by: java.sql.SQLException: Database 'wombat' shutdown.
-	... 13 more
+	... 10 more
 CALL sleep(10000) - 38000, 38000 -- InterruptedException, XJ001 -- InterruptedException
 LOCK TABLE CLOSED.LOCKME IN EXCLUSIVE MODE - 08006, 08006 -- Database 'wombat' shutdown.
 ERROR XJ015: Derby system shutdown.

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/jdk16/releaseCompileLocks.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/jdk16/releaseCompileLocks.out?view=diff&rev=469410&r1=469409&r2=469410
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/jdk16/releaseCompileLocks.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/jdk16/releaseCompileLocks.out Tue Oct 31 00:28:26 2006
@@ -47,7 +47,7 @@
 Caught exception java.sql.SQLException: The external routine is not allowed to execute SQL statements.
 java.sql.SQLException: The external routine is not allowed to execute SQL statements.
 Caused by: java.sql.SQLException: The external routine is not allowed to execute SQL statements.
-	... 31 more
+	... 28 more
 1          
 ij> select TYPE, MODE, TABLENAME, LOCKNAME, STATE from syscs_diag.lock_table
 order by 1;
@@ -67,7 +67,7 @@
 Caught exception java.sql.SQLException: The external routine is not allowed to execute SQL statements.
 java.sql.SQLException: The external routine is not allowed to execute SQL statements.
 Caused by: java.sql.SQLException: The external routine is not allowed to execute SQL statements.
-	... 31 more
+	... 28 more
 1          
 ij> -- only two locks!
 select TYPE, MODE, TABLENAME, LOCKNAME, STATE from syscs_diag.lock_table