Re: Totally weird behaviour in org.postgresql.Driver

From: Kris Jurka <books(at)ejurka(dot)com>
To: Peter <peter(at)greatnowhere(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Totally weird behaviour in org.postgresql.Driver
Date: 2009-03-12 03:44:38
Message-ID: Pine.BSO.4.64.0903112335400.25261@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
ThreadConnection.java text/plain 779 bytes

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2009-03-12 03:53:02 Re: Documentation for working with PG interval types via JDBC
Previous Message Peter 2009-03-11 14:46:48 Re: Totally weird behaviour in org.postgresql.Driver