From: Kris Jurka <books@ejurka.com>
To: Adrian Custer <acuster@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: robust handling of initial connection with net interfaces down
Date: Mon, 16 Jul 2007 01:17:54 -0400 (EDT)
Message-ID: <Pine.BSO.4.64.0707160116540.28414@leary.csoft.net> (raw)
In-Reply-To: <Pine.BSO.4.64.0704191210430.17781@leary.csoft.net>
References: <1176991545.18583.4.camel@blackpad>
<Pine.BSO.4.64.0704191210430.17781@leary.csoft.net>
On Thu, 19 Apr 2007, Kris Jurka wrote:
> On Thu, 19 Apr 2007, Adrian Custer wrote:
>
>> i'm trying to make our app's connection to postgresql robust. In
>> testing, I've noticed that if the network interfaces don't exist, the
>> java instance locks up.
>>
>> 0.setup the server e.g. localhost:5432, user:auser, password:hello
>>
>> 1. Take down your network e.g. ifdown lo
>>
>> 2. run a simple connect to postgresql jdbc such as the file attached
>>
>> ==> the file hangs indefinitely.
>>
>> Does anyone have a suggestion for preventing this?
>>
>
> The PG driver does not respect DriverManager.getLoginTimeout, although I'm
> not sure why. You can instead add the URL parameter ?loginTimeout=5 or
> similar to get a timeout on failure to setup a connection.
>
I've committed a change to CVS to make the driver check the
DriverManager's loginTimeout setting if none has been specified explicitly
via the URL.
Kris Jurka
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: books@ejurka.com, acuster@gmail.com
Subject: Re: robust handling of initial connection with net interfaces down
In-Reply-To: <Pine.BSO.4.64.0707160116540.28414@leary.csoft.net>
References: <1176991545.18583.4.camel@blackpad> <Pine.BSO.4.64.0704191210430.17781@leary.csoft.net> <Pine.BSO.4.64.0707160116540.28414@leary.csoft.net>
* 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