Lists: | pgsql-bugs |
---|
From: | "Radu Buzila" <radu(at)buzila(dot)com> |
---|---|
To: | pgsql-bugs(at)postgresql(dot)org |
Subject: | BUG #4598: flaw in hashCode() method implementation of Connection class in postgresql-8.3-604.jdbc3.jar |
Date: | 2008-12-30 22:49:33 |
Message-ID: | 200812302249.mBUMnXsv049575@wwwmaster.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-bugs |
The following bug has been logged online:
Bug reference: 4598
Logged by: Radu Buzila
Email address: radu(at)buzila(dot)com
PostgreSQL version: 8.3
Operating system: Mac OS X (OS not relevant, I'm using the thin JDBC
driver: postgresql-8.3-604.jdbc3.jar)
Description: flaw in hashCode() method implementation of Connection
class in postgresql-8.3-604.jdbc3.jar
Details:
This issue occurs when using the 8.3 thin driver
(postgresql-8.3-604.jdbc3.jar):
I have a hash that uses connection objects as keys (the hash keeps some some
transaction state data). Adding to the hash works fine but when checking if
the hash has a certain key a null pointer exception is thrown. The key used
is a not-null Connection object
(org.postgresql.ds.jdbc23.AbstractJdbc23PooledConnection) and the hash is
not empty.
A printout of the hash looks like this:
{Pooled connection wrapping physical connection null=[], Pooled connection
wrapping physical connection null=[], Pooled connection wrapping physical
connection null=[]}
(my hash values are empty ArrayList objects (not null) at this point and the
keys are Connection objects).
When executing either
theHash.containsKey(someKey)
or
theHash.remove(someKey)
(where someKey is an instance of
org.postgresql.ds.jdbc23.AbstractJdbc23PooledConnection) a
NullPoinerException is thrown and the stack trace shows:
... at
org.postgresql.ds.jdbc23.AbstractJdbc23PooledConnection$ConnectionHandler.in
voke(AbstractJdbc23PooledConnection.java:275)
at $Proxy0.hashCode(Unknown Source)
...
My immediate guess is that the method overriding Object.hashCode() is not
implemented properly and it throws a null pointer exception either in all
cases or only when the physical connection wrapped by the pooled connection
object is closed.
From: | Kris Jurka <books(at)ejurka(dot)com> |
---|---|
To: | Radu Buzila <radu(at)buzila(dot)com> |
Cc: | pgsql-bugs(at)postgresql(dot)org |
Subject: | Re: BUG #4598: flaw in hashCode() method implementation of Connection class in postgresql-8.3-604.jdbc3.jar |
Date: | 2009-01-07 05:32:36 |
Message-ID: | Pine.BSO.4.64.0901070029310.14790@leary.csoft.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-bugs |
On Tue, 30 Dec 2008, Radu Buzila wrote:
>
> The following bug has been logged online:
>
> Bug reference: 4598
> driver: postgresql-8.3-604.jdbc3.jar)
> Description: flaw in hashCode() method implementation of Connection
> class in postgresql-8.3-604.jdbc3.jar
> Details:
>
> [Pooled connections' hashCode method doesn't work after the connection
> is closed failing with a NullPointerException]
Fixed in CVS.
Kris Jurka