Re: PGXAConnection ConnectionHandler equals bug

Поиск
Список
Период
Сортировка
От Florent Guillaume
Тема Re: PGXAConnection ConnectionHandler equals bug
Дата
Msg-id CAF-4BpOC9W9_mUQuEYdGiMHD-hE6YDjbNPBhXGZzf4sSqEU6LQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: PGXAConnection ConnectionHandler equals bug  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Список pgsql-jdbc
On Mon, Oct 17, 2011 at 7:28 PM, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:
> Florent Guillaume <fg@nuxeo.com> wrote:
>> When you have a Connection coming from a XAConnection, the
>> equals() method doesn't work: conn.equals(conn) returns false.
>>
>> The reason is that it's a actually a wapper, a
>> org.postgresql.xa.PGXAConnection.ConnectionHandler, and its
>> invoke() method doesn't take into account the "equals" case to
>> unwrap the second argument as well if needed.
>
> Is the hashCode method OK?  (What affects equals usually affects
> hashCode, too.)

Yes, hashCode is delegated down the chain to the underlying
AbstractJdbc23PooledConnection.ConnectionHandler#invoke which has
consistent equals and hashCode.

Florent




--
Florent Guillaume, Director of R&D, Nuxeo
Open Source, Java EE based, Enterprise Content Management (ECM)
http://www.nuxeo.com   http://www.nuxeo.org   +33 1 40 33 79 87

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: PGXAConnection ConnectionHandler equals bug
Следующее
От: John R Pierce
Дата:
Сообщение: jdbc tcpKeepAlive parameter