Re: jdbc xa patches

From: Michael Allman <msa(at)allman(dot)ms>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: jdbc xa patches
Date: 2005-07-27 19:56:28
Message-ID: 20050727155535.M43105@yvyyl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Wed, 27 Jul 2005, Heikki Linnakangas wrote:

> On Wed, 27 Jul 2005, Michael Allman wrote:
>
>> Anyway, I'm counting on Postgres users knowing what they're doing, esp.
>> with something as non-trivial as XA support.
>
> We all know it's non-trivial, but it looks very innocent to the casual user
> who just registers two data sources to an application server. He
> doesn't see all the transaction managers and two-phase commits involved.
> To him it indeed looks trivial.
>
> Keeping that in mind, I think it's very important to give helpful error
> messages that actually give you a clue what the problem is. That means for
> example, that if the server version is too old to use two-phase commit, the
> error message should say "Your server version is too old for two-phase
> commit", not "Error executing statement PREPARE TRANSACTION 12343242".
>
> As pointed out elsewhere in this thread, you can set both the error code and
> the error message, just not directly in the XAException constructor. How
> about a little helper method to keep the rest of the code clean:
>
> private static constructXAException(int errcode, String message) {
> XAException ex = new XAException(message);
> ex.errorCode = errcode;
> return ex;
> }

Thanks for your feedback.

I'll upload another patchset with improved exceptions.

Michael

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Michael Allman 2005-07-27 19:59:56 jdbc xa serialized classes
Previous Message Heikki Linnakangas 2005-07-27 19:40:52 Re: jdbc xa patches