Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 1B3FA2E0041 for ; Tue, 19 Feb 2008 04:26:02 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 12136-03 for ; Tue, 19 Feb 2008 04:25:58 -0400 (AST) Received: from jcour.kyon.de (www.ky-on.de [213.9.98.91]) by postgresql.org (Postfix) with ESMTP id 3717E2E0044 for ; Tue, 19 Feb 2008 04:25:58 -0400 (AST) Received: from mainframe.local (1.106.113.82.net.de.o2.com [82.113.106.1]) (AUTH: LOGIN tt, SSL: TLSv1/SSLv3,256bits,AES256-SHA) by jcour.kyon.de with esmtp; Tue, 19 Feb 2008 09:25:48 +0100 id 0005CF8E.47BA928D.00008528 Message-ID: <47BA9284.5050407@kyon.de> Date: Tue, 19 Feb 2008 09:25:40 +0100 From: Till Toenges User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Oliver Jowett CC: Tom Lane , Gregory Stark , PostgreSQL - JDBC Subject: Re: Implementing setQueryTimeout() 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> In-Reply-To: <47BA470A.8000904@opencloud.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=AWL=0.001 X-Spam-Level: X-Archive-Number: 200802/140 X-Sequence-Number: 18347 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