Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 81456 invoked from network); 22 May 2007 21:24:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 May 2007 21:24:43 -0000 Received: (qmail 91700 invoked by uid 500); 22 May 2007 21:24:48 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 91666 invoked by uid 500); 22 May 2007 21:24:48 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 91657 invoked by uid 99); 22 May 2007 21:24:48 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 May 2007 14:24:48 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [192.18.1.36] (HELO gmp-ea-fw-1.sun.com) (192.18.1.36) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 May 2007 14:24:39 -0700 Received: from d1-emea-10.sun.com (d1-emea-10.sun.com [192.18.2.120]) by gmp-ea-fw-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id l4MLOGL7024326 for ; Tue, 22 May 2007 21:24:18 GMT Received: from conversion-daemon.d1-emea-10.sun.com by d1-emea-10.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) id <0JIG00C01OQE8A00@d1-emea-10.sun.com> (original mail from Knut.Hatlen@Sun.COM) for derby-dev@db.apache.org; Tue, 22 May 2007 22:24:16 +0100 (BST) Received: from localhost ([193.71.105.147]) by d1-emea-10.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPSA id <0JIG0019GOSFEV55@d1-emea-10.sun.com> for derby-dev@db.apache.org; Tue, 22 May 2007 22:24:16 +0100 (BST) Date: Tue, 22 May 2007 23:22:59 +0200 From: Knut Anders Hatlen Subject: Re: [jira] Commented: (DERBY-2472) Use Throwable.initCause() to improve error reporting In-reply-to: <4651AD84.8030003@amberpoint.com> Sender: Knut.Hatlen@Sun.COM To: derby-dev@db.apache.org Message-id: Organization: Sun Microsystems MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT References: <32471157.1179678076468.JavaMail.jira@brutus> <4650CFC4.7020005@amberpoint.com> <4651AD84.8030003@amberpoint.com> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1.50 (usg-unix-v) X-Virus-Checked: Checked by ClamAV on apache.org Bryan Pendleton writes: > Thanks for the very clear explanation, Knut Anders! > >> As I can't see that the subsequent exceptions will provide any >> significant value, I'm tempted to go for this solution. The code will be >> a lot simpler this way, and I think it would also be clearer what the >> problem is if an exception is thrown. As it is today, the last exception >> we caught is the one that is re-thrown. This exception may have a >> message that is completely unrelated to the real error, which you only >> see if you go to the end of the chain. > > +1 to all of these conclusions. The first exception is the most > important, and attempting to amalgamate multiple exception chains > into a single chain can mislead the user. Re-throwing the last exception > seems like an inferior choice to re-throwing the first. If it only were that simple... I made the change in GenericLanguageConnectionContext and BasicDependencyManager and ran derbyall and suites.All. Both had two new failures. Here's one of the diffs (they all were similar): ********* Diff file derbyall/derbylang/fk_nonSPS.diff *** Start: fk_nonSPS jdk1.6.0_01 derbyall:derbylang 2007-05-22 17:44:47 *** 321,323d320 < ERROR X0Y25: Operation 'DROP CONSTRAINT' cannot be performed on object 'PK1' because CONSTRAINT 'FK' is dependent on that object. < ERROR X0Y25: Operation 'DROP CONSTRAINT' cannot be performed on object 'PK1' because CONSTRAINT 'FK2' is dependent on that object. < ERROR X0Y25: Operation 'DROP CONSTRAINT' cannot be performed on object 'PK1' because CONSTRAINT 'FK3' is dependent on that object. 326,328d322 < ERROR X0Y25: Operation 'DROP CONSTRAINT' cannot be performed on object 'PK1' because CONSTRAINT 'FK' is dependent on that object. < ERROR X0Y25: Operation 'DROP CONSTRAINT' cannot be performed on object 'PK1' because CONSTRAINT 'FK2' is dependent on that object. < ERROR X0Y25: Operation 'DROP CONSTRAINT' cannot be performed on object 'PK1' because CONSTRAINT 'FK3' is dependent on that object. Test Failed. *** End: fk_nonSPS jdk1.6.0_01 derbyall:derbylang 2007-05-22 17:45:09 *** Before, the exception chain would show all the objects that were dependent on the object being dropped, whereas with the change, only one of the dependent objects is shown. I still think we don't lose very important information, but I also see the value of getting all the dependent objects at once. Any opinions on this? -- Knut Anders