Re: robust handling of initial connection with net interfaces down

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: robust handling of initial connection with net interfaces down
Дата
Msg-id Pine.BSO.4.64.0704191210430.17781@leary.csoft.net
обсуждение исходный текст
Ответ на robust handling of initial connection with net interfaces down  (Adrian Custer <acuster@gmail.com>)
Ответы Re: robust handling of initial connection with net interfaces down  (Kris Jurka <books@ejurka.com>)
Список pgsql-jdbc

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.

Kris Jurka


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Mohannad Hussain
Дата:
Сообщение: PG driver for J2ME?
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: PG driver for J2ME?