X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 256B152B29 for ; Wed, 27 Jul 2005 02:33:23 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 41196-04 for ; Wed, 27 Jul 2005 05:33:14 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 3E38052C30 for ; Wed, 27 Jul 2005 02:33:13 -0300 (ADT) Received: from flood.opencloud.co.nz ([192.168.0.31]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1DxeXa-0002jP-Be; Wed, 27 Jul 2005 17:33:14 +1200 Message-ID: <42E71C99.7040605@opencloud.com> Date: Wed, 27 Jul 2005 17:33:13 +1200 From: Oliver Jowett User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Michael Allman Cc: pgsql-jdbc@postgresql.org Subject: Re: jdbc xa patches References: <20050726193540.M74424@yvyyl> <42E6D231.8090002@opencloud.com> <42E6E2AD.9010104@opencloud.com> <20050726232828.S74424@yvyyl> <42E70EFE.20600@opencloud.com> <20050727011008.W74424@yvyyl> In-Reply-To: <20050727011008.W74424@yvyyl> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.009 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/353 X-Sequence-Number: 13501 Michael Allman wrote: > On Wed, 27 Jul 2005, Oliver Jowett wrote: > >> I absolutely disagree with there being no benefit. We should provide >> as much information as possible in the exception. All hhe TM *has* to >> log is the exception we give it, really, so that better have all the >> information we can give about any underlying problems. > > In cases where an XAException is thrown due to another exception, say > SQLException, I believe I was consistent in writing the cause > exception's stack trace to the DriverManager's log writer. I think that > covers logging cause exceptions for the most part. Logging stack traces to the log writer isn't acceptable really, you have no idea whether that's going somewhere that is useful. The implementation of the standard java.sql classes means that the log writer isn't useful for much beyond debugging, you pretty much have to disable it for any production use. Also, the rest of the driver chains exceptions rather than use the log writer in similar situations -- why is the XA code special? > I'm not really disputing that putting nice string messages in all our > thrown exceptions is bad, just that in this particular use case it's > probably not worth the effort. (The effort being dealing with the fact > that XAException does not take an error code and string message at once.) Put it this way: I consider generating useful exceptions a prerequisite for new code going into CVS. -O