JDBC Statement.setQueryTimeout : is there plan to implement this? - Mailing list pgsql-sql

From Sylvain Mougenot
Subject JDBC Statement.setQueryTimeout : is there plan to implement this?
Date
Msg-id CACKdPFjK_UsZ5wExD-RvBbvi6Zo-VYtoxQsCUpWXzTN9kywj7w@mail.gmail.com
Whole thread Raw
Responses Re: JDBC Statement.setQueryTimeout : is there plan to implement this?
Re: JDBC Statement.setQueryTimeout : is there plan to implement this?
List pgsql-sql
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


pgsql-sql by date:

Previous
From: Misa Simic
Date:
Subject: Re: Subselects to Joins? Or: how to design phone calls database
Next
From: Craig Ringer
Date:
Subject: Re: JDBC Statement.setQueryTimeout : is there plan to implement this?