Re: JDBC gripe list - Mailing list pgsql-jdbc

From Kevin Grittner
Subject Re: JDBC gripe list
Date
Msg-id 4D8F25CE020000250003BCCA@gw.wicourts.gov
Whole thread Raw
In response to JDBC gripe list  (Dave Cramer <pg@fastcrypt.com>)
Responses Re: JDBC gripe list
List pgsql-jdbc
> Dave Cramer  wrote:
>
> Adding to the list is statement timeout. I seem to recall the issue
> is we do not want to spawn a thread for each statement which seems
> to be the only way to do this. Alternatively we could use timers,
> but I presume they just spawn threads as well.

No, see the java.util.Timer docs:

http://download.oracle.com/javase/6/docs/api/java/util/Timer.html

Each Timer object uses one thread and can handle thousands of pending
timers.  If you're using JDBC you're on a JVM, and those all know how
to multi-thread gracefully.  A daemon thread for a group of timers
should be no big deal.

We had a patch submitted for this, which looked to me like it was
pretty close to committable.  I raised some concerns and was
intending to look at it again, but haven't gotten the requisite round
tuits yet.

-Kevin

pgsql-jdbc by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: idea to have driver return immediately after a query
Next
From: Dave Cramer
Date:
Subject: Re: idea to have driver return immediately after a query