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

Re: Implementing setQueryTimeout()

From: peter royal <peter(dot)royal(at)pobox(dot)com>
To: PostgreSQL - JDBC <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Implementing setQueryTimeout()
Date: 2008-02-18 19:14:03
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
On Feb 17, 2008, at 5:40 PM, Oliver Jowett wrote:
> (1) Map query timeout to server-side statement_timeout. Add a  
> timeout parameter to QueryExecutor methods. The protocol layer  
> remembers the current setting of statement_timeout and issues an  
> appropriate "SET statement_timeout" as necessary before submitting  
> each query.
> Advantages: Gives nice failure characteristics (query is cancelled,  
> connection remains usable)
> Disadvantages: Doesn't help with anything but slow queries on the  
> server side, relies on server-side query cancellation due to timeout  
> happening reasonably promptly. Client code that sets  
> statement_timeout itself can confuse it.

i think this is a very reasonable approach. it seems like it should  
handle the majority of the cases.


(peter.royal|osi) -

In response to

pgsql-jdbc by date

Next:From: Paul TomblinDate: 2008-02-18 19:48:24
Subject: Re: Getting "This ResultSet is closed" exceptions
Previous:From: Andres OlarteDate: 2008-02-18 19:10:56
Subject: Re: Getting "This ResultSet is closed" exceptions

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