Re: JDBC gripe list - Mailing list pgsql-jdbc

From Craig Ringer
Subject Re: JDBC gripe list
Date
Msg-id 4D914191.8050103@postnewspapers.com.au
Whole thread Raw
In response to Re: JDBC gripe list  (Dave Cramer <pg@fastcrypt.com>)
Responses Re: JDBC gripe list
Re: JDBC gripe list
List pgsql-jdbc
On 03/27/2011 11:14 PM, 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.

Timers can use one shared thread for all timers, either a generic timer
thread provided by the JVM or (IMO better in this case) one dedicated to
that timer pool. I think it'd be an ideal way to do it personally - the
JDBC driver has several issues that'd be solvable by adding a single
thread to use for various timers, etc.

If there are concerns about the driver spawning a thread, it wouldn't be
too tricky to make timer-requiring features conditional on a connection
param, so if no connections that were going to use timer-based features
were made, no thread would be spawned. Personally I don't think a single
shared thread is worth worrying about, though. Have you *seen* the
thread lists in a modern Java app? Threads are extremely low cost when
idle, and are already heavily used throughout Java and the JVM.

--
Craig Ringer

pgsql-jdbc by date:

Previous
From: Craig Ringer
Date:
Subject: Re: JDBC gripe list
Next
From: Samuel Gendler
Date:
Subject: Re: Problems with Hibernate Discriminators and 9.0-801.jdbc4