X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A35EF3A5B22 for ; Fri, 3 Dec 2004 20:45:40 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 41264-03 for ; Fri, 3 Dec 2004 20:45:35 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id B73D63A5B08 for ; Fri, 3 Dec 2004 20:45:33 +0000 (GMT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.21]) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1CaKId-0002Ma-00; Sat, 04 Dec 2004 09:45:07 +1300 Message-ID: <41B0D1B0.6040701@opencloud.com> Date: Fri, 03 Dec 2004 20:50:56 +0000 From: Oliver Jowett User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Antonini Roberto Cc: pgsql-jdbc@postgresql.org Subject: Re: connection timeout? References: <95F2F6B57A08F94FBAEE314B62B4CB1A4A6E3B@EXC01B.cselt.it> In-Reply-To: <95F2F6B57A08F94FBAEE314B62B4CB1A4A6E3B@EXC01B.cselt.it> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200412/15 X-Sequence-Number: 11681 Antonini Roberto wrote: > * I disconnected network cable between PC and DB server > The application remains blocked on > DriverManager::getConnection I'd expect this to eventually time out, but it might take several minutes. It depends on your TCP stack. > Is it a timeout issue? Yes. > If so, how can I set this timeout? Currently you can't, mostly because it hasn't been a big enough issue for anyone to step forward and implement. When implemented I'd expect it would be set via a URL parameter. The Java socket primitives makes it quite hard to do timeouts on connect anyway. Either you have to use NIO (doesn't exist until 1.4, would be an invasive change) or Socket.connect() (doesn't exist until 1.4). So you're out of luck under 1.3, and the driver will have to do conditional compilation to use 1.4-specific code as it needs to build under 1.3. -O