db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r520663 - in /db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc: EmbedConnection.java TransactionResourceImpl.java
Date Tue, 20 Mar 2007 23:44:33 GMT
Author: djd
Date: Tue Mar 20 16:44:32 2007
New Revision: 520663

URL: http://svn.apache.org/viewvc?view=rev&rev=520663
Log:
Set Throwable.initCause() in a couple of locations at the JDBC level where we setup nested
SQLExceptions.
This means that automatically the stack trace for a database failed to start includes the
reason
for the failure, rather than just "see next exception". This is a great help when running
JUnit tests and getting failures to start a database.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/TransactionResourceImpl.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java?view=diff&rev=520663&r1=520662&r2=520663
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java Tue Mar
20 16:44:32 2007
@@ -1804,6 +1804,7 @@
 				nse = Util.generateCsSQLException(mse);
 
 			se.setNextException(nse);
+            se.initCause(nse);
 			throw se;
 		}
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/TransactionResourceImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/TransactionResourceImpl.java?view=diff&rev=520663&r1=520662&r2=520663
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/TransactionResourceImpl.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/TransactionResourceImpl.java
Tue Mar 20 16:44:32 2007
@@ -401,6 +401,7 @@
 
 		if (sqlException != null) {
 			sqlException.setNextException(nextSQLException);
+            sqlException.initCause(nextSQLException);
 		}
 
 		return nextSQLException;



Mime
View raw message