Re: Totally weird behaviour in org.postgresql.Driver - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: Totally weird behaviour in org.postgresql.Driver
Date
Msg-id Pine.BSO.4.64.0903112335400.25261@leary.csoft.net
Whole thread Raw
In response to Re: Totally weird behaviour in org.postgresql.Driver  ("Peter" <peter@greatnowhere.com>)
Responses Re: Totally weird behaviour in org.postgresql.Driver
List pgsql-jdbc

On Wed, 11 Mar 2009, Peter wrote:

>
> I added a bunch more synchronized (mutex) blocks in my code to avoid
> getConnection being called simultaneously from multiple threads (why isnt
> that method synchronized anyway?) - so far so good... keeping fingers
> crossed. Maybe should have just subclassed PGSimpleDataSource...

I'm not sure why it needs to be synchronized.  The attached test case (20
threads each opening and closing connections as fast as possible) doesn't
show any problems for me.  Does it fail for you?  Is there a particular
change that fixes it for you?

Kris Jurka

Attachment

pgsql-jdbc by date:

Previous
From: "Peter"
Date:
Subject: Re: Totally weird behaviour in org.postgresql.Driver
Next
From: Kris Jurka
Date:
Subject: Re: Documentation for working with PG interval types via JDBC