On Thu, 11 Feb 2010, Andrew Chernow wrote:
>
> Although, I think Dave's comments have made me change my mind about this
> patch. Looks like it serves a good purpose. That said, there is no
> guarentee the driver will implement the new feature ... JDBC seems to
> lack the ability to get the backing Socket object but java can set
> socket options. Maybe a JDBC kong fu master knows how to do this.
Use the tcpKeepAlive connection option as described here:
http://jdbc.postgresql.org/documentation/84/connect.html#connection-parameters
Java can only enable/disable keep alives, it can't set the desired
timeout.
http://java.sun.com/javase/6/docs/api/java/net/Socket.html#setKeepAlive%28boolean%29
Kris Jurka