From: Till Toenges <tt@kyon.de>
To: Oliver Jowett <oliver@opencloud.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Gregory Stark <stark@enterprisedb.com>
Cc: PostgreSQL - JDBC <pgsql-jdbc@postgresql.org>
Subject: Re: Implementing setQueryTimeout()
Date: Tue, 19 Feb 2008 09:25:40 +0100
Message-ID: <47BA9284.5050407@kyon.de> (raw)
In-Reply-To: <47BA470A.8000904@opencloud.com>
References: <47B8E200.2020307@opencloud.com>
<5350.1203299903@sss.pgh.pa.us>
<47B8EB1C.8090802@opencloud.com>
<87ejbao6bg.fsf@oxford.xeocode.com>
<47BA2A6E.6050907@opencloud.com>
<17814.1203384054@sss.pgh.pa.us>
<47BA470A.8000904@opencloud.com>
Oliver Jowett wrote:
> setQueryTimeout() is documented as:
>
>> Sets the number of seconds the driver will wait for a Statement object
>> to execute to the given number of seconds. If the limit is exceeded,
>> an SQLException is thrown.
>
> That would seem to cover any sort of delay, not just "it is a slow query
> on the server side". If the Statement can't execute in N seconds, return
> an error. That could mean slow network - slow query - whatever.
>
> I don't see why clients that want timeouts care about the cause of the
> slowness - all they care about is that they get control back within
> some reasonable amount of time, surely? What's the use case where you
> would use setQueryTimeout() but don't actually mean "give me control
> back in N seconds"?
The documentation is unclear. But i think it is intended to limit the
execution time on the server.
And i do care about the cause of the slowness. If i call
setQueryTimeout(), i expect to be able to use the connection after a
timeout, including everything i had SET before, prepared statements etc.
A network timeout or anything worse is handled in an entirely different
part of the code. That is not the responsibility of the driver, and
doesn't event need to be part of the database related code at all.
Till
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: tt@kyon.de, oliver@opencloud.com, tgl@sss.pgh.pa.us, stark@enterprisedb.com
Subject: Re: Implementing setQueryTimeout()
In-Reply-To: <47BA9284.5050407@kyon.de>
References: <47B8E200.2020307@opencloud.com> <5350.1203299903@sss.pgh.pa.us> <47B8EB1C.8090802@opencloud.com> <87ejbao6bg.fsf@oxford.xeocode.com> <47BA2A6E.6050907@opencloud.com> <17814.1203384054@sss.pgh.pa.us> <47BA470A.8000904@opencloud.com> <47BA9284.5050407@kyon.de>
* 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