pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Michael Allman <msa@allman.ms>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: jdbc xa patches
Date: Wed, 27 Jul 2005 22:40:52 +0300 (EEST)
Message-ID: <Pine.OSF.4.61.0507272233170.186794@kosh.hut.fi> (raw)
In-Reply-To: <20050727005909.W74424@yvyyl>
References: <20050726193540.M74424@yvyyl>
	<42E6D231.8090002@opencloud.com>
	<20050726225605.T74424@yvyyl>
	<42E70E8E.9010408@opencloud.com>
	<20050727005909.W74424@yvyyl>

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;
}

- Heikki



view thread (18+ messages)  latest in thread

Message-ID: <Pine.OSF.4.61.0507272233170.186794@kosh.hut.fi>
Permalink:  ../Pine.OSF.4.61.0507272233170.186794@kosh.hut.fi/
Also on:    postgresql.org/message-id/Pine.OSF.4.61.0507272233170.186794@kosh.hut.fi

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: hlinnaka@iki.fi, msa@allman.ms
  Subject: Re: jdbc xa patches
  In-Reply-To: <Pine.OSF.4.61.0507272233170.186794@kosh.hut.fi>
  References: <20050726193540.M74424@yvyyl> <42E6D231.8090002@opencloud.com> <20050726225605.T74424@yvyyl> <42E70E8E.9010408@opencloud.com> <20050727005909.W74424@yvyyl> <Pine.OSF.4.61.0507272233170.186794@kosh.hut.fi>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox