pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Andrea Spinelli <aspinelli@imteam.it>
Cc: pgsql-jdbc@postgresql.org
Cc: Alessandro Magnolo <amagnolo@imteam.it>
Cc: Valerio Mazzoleni <vmazzoleni@imteam.it>
Subject: Re: executeQuery hangs on busy server - PROPOSAL: socketTimeout parameter
Date: Fri, 10 Aug 2007 05:43:47 -0400 (EDT)
Message-ID: <Pine.BSO.4.64.0708100538530.31534@leary.csoft.net> (raw)
In-Reply-To: <46BC20B6.4080409@imteam.it>
References: <46BC20B6.4080409@imteam.it>



On Fri, 10 Aug 2007, Andrea Spinelli wrote:

> I am using jdbc to access a large database on a busy PostgreSQL server (8.1) 
> hosted on Windows, from several web applications.
>
> Occasionally, my executeQuery hang forever. They block on a read operation in 
> SocketInputStream.socketRead0 (seen on the debugger) and stay there for 
> _days_. They disappear only by stopping the application server (Tomcat).

I believe this is a bug in the 8.1 windows port.  What's the exact version 
you are using?  I think this was fixed in 8.1.6.

>       connection.setSoTimeout( 120000 );
>
> Long queries (>2min) fail with a SQLException signalling a communication 
> problem with the server - which is what I want.
>
> I think this could be reworked into one more connection parameter 
> "socketTimeout", where 0 means no timeout; the value of the parameter would 
> of course substitute the hard-coded 120000.
>
> I've seen a feature request on GBorg about stopping long-running queries, 
> which could be satisfied by what I'm proposing. (actually, the connection 
> parameter works connection-wide, while the feature request deals with single 
> queries).

People want the query to be stopped, but they don't want their whole 
connection to be killed which is what your change does.

Kris Jurka



view thread (6+ messages)  latest in thread

Message-ID: <Pine.BSO.4.64.0708100538530.31534@leary.csoft.net>
Permalink:  ../Pine.BSO.4.64.0708100538530.31534@leary.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.64.0708100538530.31534@leary.csoft.net

 · 

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: books@ejurka.com, aspinelli@imteam.it, amagnolo@imteam.it, vmazzoleni@imteam.it
  Subject: Re: executeQuery hangs on busy server - PROPOSAL: socketTimeout parameter
  In-Reply-To: <Pine.BSO.4.64.0708100538530.31534@leary.csoft.net>
  References: <46BC20B6.4080409@imteam.it> <Pine.BSO.4.64.0708100538530.31534@leary.csoft.net>

* 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