Skip site navigation (1) Skip section navigation (2)

Re: Patch to add a socketTimeout property.

From: Art Gramlich <art(dot)gramlich(at)healthtrio(dot)com>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: Toru SHIMOGAKI <shimogaki(dot)toru(at)oss(dot)ntt(dot)co(dot)jp>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Patch to add a socketTimeout property.
Date: 2008-04-11 17:02:53
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
I agree completely that keepalive is the more correct solution but  
that the ability to set the timeout to something reasonable is a plus  
for sotimeout.
That said, I'll take a shot at listing a few pros and cons for  
allowing access to either.

1. It could be confusing to a developer when the connection if a  
connection is dropped (especially when doing a long running query).
2. I'm assuming (and please correct me if not) that postgresql will  
continue to run a long query until trying to access the socket again.   
If true, code could be written where it leads to a user submitting the  
same long running queries to the database thinking there is just a  
transient problem.

1. Either or both are useful in unusual/unreliable networking  
2. With correct settings and infrastructure, allowing the socket close  
itself, can keep a connection pool from filling and threads from  
3. Setting sotimeout is available in some other major drivers (Oracle  
odbc5, IBM db2jcc and jdts).

Art Gramlich
Chief Application Architect
HealthTrio, LLC

On Apr 10, 2008, at 5:51 PM, Kris Jurka wrote:

> On Thu, 10 Apr 2008, Art Gramlich wrote:
>> They do.  We usually have different connection pools for normal  
>> (short running) and long queries.  Since almost all are short  
>> running, this has worked well for us.  I actually haven't tried  
>> setting keepalive in this situation. so I can't say much, but the  
>> vpn solutions we have used have at times gotten into some pretty  
>> wierd states and sotimeouts could stop our pools from going crazy.
> I can see how keepalives are generally useful while sotimeouts are  
> only useful in the specific situation where you can set a global  
> limit on your query times.  On the other hand the sotimeout is  
> configurable while the keepalive timeout isn't configurable (at  
> least in Java).  I'm not particularly excited about either option,  
> but I don't need them either.
> I don't see a danger with exposing them as options as long as the  
> pros and cons are clearly explained.
> Kris Jurka

In response to

pgsql-jdbc by date

Next:From: Toru SHIMOGAKIDate: 2008-04-12 00:27:07
Subject: Re: Patch to add a socketTimeout property.
Previous:From: Kris JurkaDate: 2008-04-11 00:51:44
Subject: Re: Patch to add a socketTimeout property.

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group