Re: jdbc xa patches - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: jdbc xa patches
Date
Msg-id 42E6E2AD.9010104@opencloud.com
Whole thread Raw
In response to Re: jdbc xa patches  (Oliver Jowett <oliver@opencloud.com>)
Responses Re: jdbc xa patches
List pgsql-jdbc
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

pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: jdbc xa patches
Next
From: Michael Allman
Date:
Subject: Re: jdbc xa patches