pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Antonini Roberto <Roberto.Antonini@tilab.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: connection timeout?
Date: Fri, 03 Dec 2004 20:50:56 +0000
Message-ID: <41B0D1B0.6040701@opencloud.com> (raw)
In-Reply-To: <95F2F6B57A08F94FBAEE314B62B4CB1A4A6E3B@EXC01B.cselt.it>
References: <95F2F6B57A08F94FBAEE314B62B4CB1A4A6E3B@EXC01B.cselt.it>

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



view thread (3+ messages)

Message-ID: <41B0D1B0.6040701@opencloud.com>
Permalink:  ../41B0D1B0.6040701@opencloud.com/
Also on:    postgresql.org/message-id/41B0D1B0.6040701@opencloud.com

 · 

reply

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: oliver@opencloud.com, Roberto.Antonini@tilab.com
  Subject: Re: connection timeout?
  In-Reply-To: <41B0D1B0.6040701@opencloud.com>
  References: <95F2F6B57A08F94FBAEE314B62B4CB1A4A6E3B@EXC01B.cselt.it> <41B0D1B0.6040701@opencloud.com>

* 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