Re: XADataSource interface - Mailing list pgsql-jdbc

From Heikki Linnakangas
Subject Re: XADataSource interface
Date
Msg-id Pine.OSF.4.61.0510302203590.179385@kosh.hut.fi
Whole thread Raw
In response to XADataSource interface  (Heikki Linnakangas <hlinnaka@iki.fi>)
List pgsql-jdbc
On Sun, 30 Oct 2005, Chris Smith wrote:

> Heikki Linnakangas wrote:
>> 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 look too closely at the patch... but the API docs for Object.equals
> say clearly that this shouldn't be a problem.  For any non-null reference x,
> x.equals(null) should evaluate to false.  I suspect that the correct solution
> to this problem is to fix the implementation of equals, and not to add a
> check against null where you did.

True. However, since the object is supplied by the transaction manager
implementation, which we have no control over, I'd say it's better to
not make any assumptions about it that we don't have to.

- Heikki

pgsql-jdbc by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: XADataSource interface
Next
From:
Date:
Subject: OT-Exibir un "byte[] imgBytes" via JSP