Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 6F0252E0047 for ; Tue, 19 Feb 2008 04:41:15 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 20543-04 for ; Tue, 19 Feb 2008 04:41:09 -0400 (AST) Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by postgresql.org (Postfix) with ESMTP id 5D75F2E0043 for ; Tue, 19 Feb 2008 04:41:12 -0400 (AST) Received: from 219-89-100-120.jetstart.xtra.co.nz ([219.89.100.120] helo=[192.168.1.3]) by tremor.opencloud.co.nz with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1JRO2D-0007Q8-7X; Tue, 19 Feb 2008 21:41:05 +1300 Message-ID: <47BA9626.5060209@opencloud.com> Date: Tue, 19 Feb 2008 21:41:10 +1300 From: Oliver Jowett User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Till Toenges 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> <47BA9284.5050407@kyon.de> <47BA92EA.1070201@opencloud.com> <47BA95D5.40408@kyon.de> In-Reply-To: <47BA95D5.40408@kyon.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/145 X-Sequence-Number: 18352 Till Toenges wrote: > Oliver Jowett wrote: >>> 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. >> >> I'm not sure what you mean here - if the connection to the DB fails, >> the driver will certainly handle that and tell you about it via a >> SQLException! > > Sorry. Of course the driver must handle failed connections. I meant the > code in my application, which handles the two cases (timeout but usable > connection vs broken connection for whatever reason) differently. You can check the SQLState of any exception thrown to tell the difference, right? -O