Re: jdbc xa patches

From: Michael Allman <msa(at)allman(dot)ms>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: jdbc xa patches
Date: 2005-07-27 05:13:39
Message-ID: 20050727011008.W74424@yvyyl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Wed, 27 Jul 2005, Oliver Jowett wrote:

> Michael Allman wrote:
>> On Wed, 27 Jul 2005, Oliver Jowett wrote:
>>
>>> 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.
>
>> Since the client of a PGXAResource instance is a transaction manager I see
>> no benefit. The transaction manager will make a decision on what to do
>> based on the code carried by XAException and carry on. Maybe it will log a
>> message.
>
> 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.

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.)

Michael

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2005-07-27 05:27:57 Re: jdbc xa patches
Previous Message Michael Allman 2005-07-27 05:09:46 Re: jdbc xa patches