Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 35012 invoked from network); 30 Jan 2007 12:49:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Jan 2007 12:49:30 -0000 Received: (qmail 91409 invoked by uid 500); 30 Jan 2007 12:49:36 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 91388 invoked by uid 500); 30 Jan 2007 12:49:36 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 91377 invoked by uid 99); 30 Jan 2007 12:49:36 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Jan 2007 04:49:36 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Jan 2007 04:49:29 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 5ECEB1A981D; Tue, 30 Jan 2007 04:49:09 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r501392 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/SQLExceptionFactory40.java Date: Tue, 30 Jan 2007 12:49:09 -0000 To: derby-commits@db.apache.org From: kahatlen@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070130124909.5ECEB1A981D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: kahatlen Date: Tue Jan 30 04:49:08 2007 New Revision: 501392 URL: http://svn.apache.org/viewvc?view=rev&rev=501392 Log: DERBY-2141 (partial) BlobClob4BlobTest.testPositionBlob() fails with NullPointerException Preserve original stack trace for exceptions in JDBC 4.0 driver. Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/SQLExceptionFactory40.java 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=501392&r1=501391&r2=501392 ============================================================================== --- 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 Jan 30 04:49:08 2007 @@ -131,7 +131,21 @@ private SQLException wrapArgsForTransportAcrossDRDA ( String message, String messageId, SQLException next, int severity, Throwable t, Object[] args ) { - return super.getSQLException( message, messageId, next, severity, t, args ); + // Generate an EmbedSQLException + SQLException e = + super.getSQLException(message, messageId, next, severity, t, args); + + // We want to preserve the stack trace of the original + // exception. EmbedSQLException overrides printStackTrace() to achieve + // this, but that won't help us when the EmbedSQLException is not the + // first exception in the chain. Ideally, we would use initCause(), but + // a comment in EmbedSQLException indicates that the cause of the + // exception is not supposed to be serialized. + if (t != null) { + e.setStackTrace(t.getStackTrace()); + } + + return e; } }