proposal: setKeepAlive
От | Toru SHIMOGAKI |
---|---|
Тема | proposal: setKeepAlive |
Дата | |
Msg-id | 47AC666C.9070704@oss.ntt.co.jp обсуждение исходный текст |
Ответы |
Re: proposal: setKeepAlive
|
Список | pgsql-jdbc |
Hi, The attached makes tcp-keep-alive enable. When PostgreSQL server gets down or network gets down, client application can't receive any response from the server. PostgreSQL server has GUC parameters: tcp_keepalives_* and statement_timeout, but JDBC doesn't have such features. setQueryTimeout() is not implemented so far, so setKeepAlive() is needed for above situation at the very least. Best regards, -- Toru SHIMOGAKI<shimogaki.toru@oss.ntt.co.jp> NTT Open Source Software Center diff -cpr postgresql-jdbc-8.3-603.src-orig/org/postgresql/core/PGStream.java postgresql-jdbc-8.3-603.src/org/postgresql/core/PGStream.java *** postgresql-jdbc-8.3-603.src-orig/org/postgresql/core/PGStream.java 2008-02-08 16:42:59.000000000 +0900 --- postgresql-jdbc-8.3-603.src/org/postgresql/core/PGStream.java 2008-02-08 21:29:38.000000000 +0900 *************** public class PGStream *** 107,112 **** --- 107,115 ---- // really need to. connection.setTcpNoDelay(true); + // Enable tcp keep alive timer + connection.setKeepAlive(true); + // Buffer sizes submitted by Sverre H Huseby <sverrehu@online.no> pg_input = new VisibleBufferedInputStream(connection.getInputStream(), 8192); pg_output = new BufferedOutputStream(connection.getOutputStream(), 8192);
В списке pgsql-jdbc по дате отправления: