pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <ringerc@ringerc.id.au>
To: Mike Charnoky <noky@nextbus.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Hung JDBC connections
Date: Tue, 12 Jun 2012 15:12:01 +0800
Message-ID: <4FD6EBC1.1000006@ringerc.id.au> (raw)
In-Reply-To: <4FD60870.4040304@nextbus.com>
References: <4FD20A3F.70602@nextbus.com>
	<4FD416D9.8020808@ringerc.id.au>
	<4FD60870.4040304@nextbus.com>

On 06/11/2012 11:02 PM, Mike Charnoky wrote:
>
> On 06/09/2012 11:39 PM, Craig Ringer wrote:
>>
>> Of course, It's not very friendly for the JDBC driver to wait 
>> indefinitely without periodically checking and seeing if the 
>> connection was progressing, so I'm glad to see that's changed in  9.1.
>>
> I took a look at the 9.1 JDBC driver source code, very enlightening. I 
> see that Statement.setQueryTimeout() doesn't actually do anything! The 
> method sets a member variable which is never accessed locally or by 
> any subclasses or via getQueryTimeout(). There is even the following 
> comment in AbstractJdbc2Statement:
>     /** Timeout (in seconds) for a query (not used) */
>     protected int timeout = 0;
>
> I see that ConnectionFactoryImpl does allow the underlying Socket's 
> so_timeout and so_keepalive options to be set using the connection 
> parameters string: 
> http://jdbc.postgresql.org/documentation/91/connect.html 
> (socketTimeout and tcpKeepAlive). Didn't realize these options 
> existed, I will definitely be taking advantage of these.
>
> However, I see these options were available as far back as 8.4. What 
> exactly are these driver changes in 9.1 that you mentioned???

Sorry, as Dave points out, 9.2.

--
Craig Ringer



view thread (9+ messages)

Message-ID: <4FD6EBC1.1000006@ringerc.id.au>
Permalink:  ../4FD6EBC1.1000006@ringerc.id.au/
Also on:    postgresql.org/message-id/4FD6EBC1.1000006@ringerc.id.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: ringerc@ringerc.id.au, noky@nextbus.com
  Subject: Re: Hung JDBC connections
  In-Reply-To: <4FD6EBC1.1000006@ringerc.id.au>
  References: <4FD20A3F.70602@nextbus.com> <4FD416D9.8020808@ringerc.id.au> <4FD60870.4040304@nextbus.com> <4FD6EBC1.1000006@ringerc.id.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