Re: jdbc tcpKeepAlive parameter

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: jdbc tcpKeepAlive parameter
Дата
Msg-id CA+0W9LNznYag9+4NzVJbL9zcFkwQSLdKiRA6M2Gi0TLiuELuTg@mail.gmail.com
обсуждение исходный текст
Ответ на jdbc tcpKeepAlive parameter  (John R Pierce <pierce@hogranch.com>)
Список pgsql-jdbc
On 19 October 2011 12:42, John R Pierce <pierce@hogranch.com> wrote:
> the documentation is a little skimpy on the operation of tcpKeepAlive...
>
> we've got a scenario where the java client applications sometimes abort
> without cleaning up, and leave a postgres server process just sitting there.
>     I'm assuming tcpKeepAlive=true would cause these processes to timeout
> eventually and clean themselves up?   Is this a 2-way keepalive, in that if
> the server process dies, the client connection would timeout, too?

tcpKeepAlive just sets SO_KEEPALIVE on the client socket. These TCP
keepalives are outgoing only.
If you want to detect a dead client, you'll need to set the keepalive
options on the server side.

> on libpq, there's some options for the keepalive interval and count, but I
> don't see any such in JDBC?

Java's socket API only exposes SO_KEEPALIVE, not the finer tuning
options, so we're stuck with the defaults.

Oliver

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

Предыдущее
От: John R Pierce
Дата:
Сообщение: jdbc tcpKeepAlive parameter
Следующее
От: Ana Carolina Comandulli
Дата:
Сообщение: revision of the translation to pt_BR