Re: jdbc tcpKeepAlive parameter

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: John R Pierce <pierce(at)hogranch(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: jdbc tcpKeepAlive parameter
Date: 2011-10-19 00:12:11
Message-ID: CA+0W9LNznYag9+4NzVJbL9zcFkwQSLdKiRA6M2Gi0TLiuELuTg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On 19 October 2011 12:42, John R Pierce <pierce(at)hogranch(dot)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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Robert Haas 2011-10-19 12:01:02 Re: BUG #6253: JDBC driver: getIndexInfo() returns quotes around quoted column names
Previous Message John R Pierce 2011-10-18 23:42:42 jdbc tcpKeepAlive parameter