JDBC Statement.setQueryTimeout : is there plan to implement this?

Поиск
Список
Период
Сортировка
От Sylvain Mougenot
Тема JDBC Statement.setQueryTimeout : is there plan to implement this?
Дата
Msg-id CACKdPFjK_UsZ5wExD-RvBbvi6Zo-VYtoxQsCUpWXzTN9kywj7w@mail.gmail.com
обсуждение исходный текст
Ответы Re: JDBC Statement.setQueryTimeout : is there plan to implement this?  (Craig Ringer <ringerc@ringerc.id.au>)
Re: JDBC Statement.setQueryTimeout : is there plan to implement this?  (Craig Ringer <ringerc@ringerc.id.au>)
Список 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 по дате отправления:

Предыдущее
От: Misa Simic
Дата:
Сообщение: Re: Subselects to Joins? Or: how to design phone calls database
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: JDBC Statement.setQueryTimeout : is there plan to implement this?