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 C1A3F52A97 for ; Tue, 26 Jul 2005 22:26:08 -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 82587-09 for ; Wed, 27 Jul 2005 01:26:02 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 457D152C0B for ; Tue, 26 Jul 2005 22:26:01 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1DxagP-000120-Ot; Wed, 27 Jul 2005 13:26:05 +1200 Message-ID: <42E6E2AD.9010104@opencloud.com> Date: Wed, 27 Jul 2005 13:26:05 +1200 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050324) 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> In-Reply-To: <42E6D231.8090002@opencloud.com> X-Enigmail-Version: 0.90.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 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/345 X-Sequence-Number: 13493 Oliver Jowett wrote: > Shouldn't the XAResource check the server version on construction or on > start()/recover() to make sure that it's actually going to be able to > use PREPARE TRANSACTION later? Or is erroring out with a syntax error at > the point of prepare() sufficient? (I'd like to see a better error > message there at least) More generally: can we get XAExceptions thrown with useful messages? It seems like there's no direct constructor that gives you both message and error code, but the error code is a public field so you can set it after construction before throwing. Also, in the case where the failure is caused by another exception, we should generally chain that exception rather than writing it to the log writer. See how PSQLException does this for details.. There's enough meddling there that it might be worth subclassing XAException to automate it all.. or have a helper method somewhere. -O