pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <craig@postnewspapers.com.au>
To: Dave Cramer <pg@fastcrypt.com>
Cc: List <pgsql-jdbc@postgresql.org>
Subject: Re: JDBC gripe list
Date: Tue, 29 Mar 2011 10:18:57 +0800
Message-ID: <4D914191.8050103@postnewspapers.com.au> (raw)
In-Reply-To: <AANLkTi=+JZvbmJnjjJZZGvxb4oetzwZ1KH3SHqJ-SBJm@mail.gmail.com>
References: <AANLkTik0kW5_jCAc7h0T_Q5cCGx=tunasHJ=nf0X=+ij@mail.gmail.com>
	<AANLkTi=+JZvbmJnjjJZZGvxb4oetzwZ1KH3SHqJ-SBJm@mail.gmail.com>

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



view thread (65+ messages)  latest in thread

Message-ID: <4D914191.8050103@postnewspapers.com.au>
Permalink:  ../4D914191.8050103@postnewspapers.com.au/
Also on:    postgresql.org/message-id/4D914191.8050103@postnewspapers.com.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: craig@postnewspapers.com.au, pg@fastcrypt.com
  Subject: Re: JDBC gripe list
  In-Reply-To: <4D914191.8050103@postnewspapers.com.au>
  References: <AANLkTik0kW5_jCAc7h0T_Q5cCGx=tunasHJ=nf0X=+ij@mail.gmail.com> <AANLkTi=+JZvbmJnjjJZZGvxb4oetzwZ1KH3SHqJ-SBJm@mail.gmail.com> <4D914191.8050103@postnewspapers.com.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox