Re: XADataSource interface

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: pg(at)fastcrypt(dot)com, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: XADataSource interface
Date: 2005-10-30 19:21:33
Message-ID: Pine.OSF.4.61.0510302111470.179385@kosh.hut.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Sat, 29 Oct 2005, Kris Jurka wrote:

> On Tue, 25 Oct 2005, Heikki Linnakangas wrote:
>
>> I posted an updated version of the XADataSource implementation few weeks
>> ago, but haven't received any comments:
>>
>
> Dave has committed this and I've made some further integration fixes to it,
> but some of the tests you've provided fail with the attached errors. I don't
> know much about XA, so I wanted to run some potential fixes by you guys
> first. Thoughts?

It seems I forgot to run the tests myself before submitting, sorry about
that...

The test failure at testOnePhase was caused by the inverted equals test
you already noticed and fixed in your patch.

The failures at testRecover and testRollback were because
PGXAConnection.rollback method called Xid.equals with null argument.
I added a null-check for that, see attached patch.

I didn't understand this part of your patch:

--------------------------------------------------------------------------
diff -c -r1.2 PGXAConnection.java
*** org/postgresql/xa/PGXAConnection.java 29 Oct 2005 18:59:39 -0000
1.2
--- org/postgresql/xa/PGXAConnection.java 29 Oct 2005 19:05:09 -0000
***************
*** 172,178 ****
throw new PGXAException(GT.tr("Prepare called before end"),
XAException.XAER_INVAL);

state = STATE_IDLE;
! currentXid = null;

if (!conn.haveMinimumServerVersion("8.1"))
throw new PGXAException(GT.tr("Server versions prior to 8.1
do not support two-phase
commit."), XAException.XAER_RMERR);
--- 172,178 ----
throw new PGXAException(GT.tr("Prepare called before end"),
XAException.XAER_INVAL);

state = STATE_IDLE;
! // currentXid = null;

if (!conn.haveMinimumServerVersion("8.1"))
throw new PGXAException(GT.tr("Server versions prior to 8.1
do not support two-phase
commit."), XAException.XAER_RMERR);
--------------------------------------------------------------------------

Why is that? It looks wrong to me.

- Heikki

Attachment Content-Type Size
xafixes2.patch text/plain 1.5 KB

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Heikki Linnakangas 2005-10-30 20:07:24 Re: XADataSource interface
Previous Message Kris Jurka 2005-10-29 19:12:06 Re: XADataSource interface