Index: java/engine/org/apache/derby/impl/jdbc/SQLExceptionFactory40.java =================================================================== --- java/engine/org/apache/derby/impl/jdbc/SQLExceptionFactory40.java (revision 466937) +++ java/engine/org/apache/derby/impl/jdbc/SQLExceptionFactory40.java (working copy) @@ -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,14 +91,13 @@ 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; } Index: java/testing/org/apache/derbyTesting/functionTests/master/jdk16/closed.out =================================================================== --- java/testing/org/apache/derbyTesting/functionTests/master/jdk16/closed.out (revision 466937) +++ java/testing/org/apache/derbyTesting/functionTests/master/jdk16/closed.out (working copy) @@ -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. Index: java/testing/org/apache/derbyTesting/functionTests/master/jdk16/releaseCompileLocks.out =================================================================== --- java/testing/org/apache/derbyTesting/functionTests/master/jdk16/releaseCompileLocks.out (revision 466937) +++ java/testing/org/apache/derbyTesting/functionTests/master/jdk16/releaseCompileLocks.out (working copy) @@ -31,7 +31,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; @@ -51,7 +51,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