Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id D2F95EEA159 for ; Wed, 14 Dec 2011 09:29:55 -0400 (AST) Received: from eu1sys200aog109.obsmtp.com ([207.126.144.127]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Raou8-0006BQ-Hm for pgsql-sql@postgresql.org; Wed, 14 Dec 2011 13:29:54 +0000 Received: from mail-fx0-f53.google.com ([209.85.161.53]) (using TLSv1) by eu1sys200aob109.postini.com ([207.126.147.11]) with SMTP ID DSNKTuikw7tcVcS4p5h/2BC2ai9eHBtAYSDS@postini.com; Wed, 14 Dec 2011 13:29:52 UTC Received: by mail-fx0-f53.google.com with SMTP id a5so1311585faa.12 for ; Wed, 14 Dec 2011 05:29:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.180.81.163 with SMTP id b3mr4724392wiy.20.1323869379606; Wed, 14 Dec 2011 05:29:39 -0800 (PST) Received: by 10.180.94.6 with HTTP; Wed, 14 Dec 2011 05:29:39 -0800 (PST) Date: Wed, 14 Dec 2011 14:29:39 +0100 Message-ID: Subject: JDBC Statement.setQueryTimeout : is there plan to implement this? From: Sylvain Mougenot To: pgsql-sql@postgresql.org Content-Type: multipart/alternative; boundary=f46d0444027219b7db04b40d5c77 X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201112/49 X-Sequence-Number: 36110 --f46d0444027219b7db04b40d5c77 Content-Type: text/plain; charset=ISO-8859-1 Query timeout is not supported in JDBC (driver version 9.1-901.jdbc4) Statement.setQueryTimeout(int seconds) throws an exception when seconds > 0. (in drivers prior to 8.3 there was no error but it was ignored) Using Java + transaction management, we are missing this feature badly. I found people trying to fallback using "SELECT statement_timeout(SEC)". But this is useless in many cases (I mean transaction manager does it's work independently) : - my code do not directly decides to start a transaction - some code may have different transaction settings So I couldn't easily introduce the good select statement at the right moment. Even if the behaviour is not implemented, I guess it could be "mocked" if the call to Statement.setQueryTimeout(int seconds) generated the select statement "SELECT statement_timeout(SEC)". I know this is not ideal but could solve the problem temporarily. I could even be turned on by some driver settings. -- Sylvain Mougenot --f46d0444027219b7db04b40d5c77 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Query timeout is not supported in JDBC (driver version=A09.1-901.jdbc4= )
Statement.setQueryTimeout(int seconds) throws an exception when= seconds > 0.
(in drivers prior to 8.3 there was no error but = it was ignored)

Using Java + transaction management, we are missing thi= s feature badly.
I found people trying to fallback using=A0"= SELECT statement_timeout(SEC)".
But this is useless in many = cases (I mean transaction manager does it's work independently) :=A0
- my code do not directly decides to start a transaction
- s= ome code may have different transaction settings
So I couldn'= t easily introduce the good select statement at the right moment.

Even if the behaviour is not implemented, I guess it co= uld be "mocked" if the call to=A0Statement.setQueryTimeout(int se= conds) generated the select statement=A0"SELECT statement_timeout(SEC)= ".
I know this is not ideal but could solve the problem temporarily.
I could even be turned on by some driver settings.

--
Sylvain Mougenot


--f46d0444027219b7db04b40d5c77--