From: | Kris Jurka <books(at)ejurka(dot)com> |
---|---|
To: | Adrian Custer <acuster(at)gmail(dot)com> |
Cc: | pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: robust handling of initial connection with net interfaces down |
Date: | 2007-07-16 05:17:54 |
Message-ID: | Pine.BSO.4.64.0707160116540.28414@leary.csoft.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
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
From | Date | Subject | |
---|---|---|---|
Next Message | Oliver Jowett | 2007-07-16 06:24:15 | Re: patch - support for multi-dimensional arrays and NULL values |
Previous Message | Kris Jurka | 2007-07-16 04:40:19 | Re: patch - support for multi-dimensional arrays and NULL values |