Re: Re: BUG #4123: Statement.setQueryTimeout does not work with Postgres Java Driver
В списке pgsql-bugs по дате отправления:
| От | Kris Jurka |
|---|---|
| Тема | Re: Re: BUG #4123: Statement.setQueryTimeout does not work with Postgres Java Driver |
| Дата | |
| Msg-id | Pine.BSO.4.64.0804240622340.11234@leary.csoft.net обсуждение исходный текст |
| Ответ на | Re: BUG #4123: Statement.setQueryTimeout does not work with Postgres Java Driver (valgog <valgog@gmail.com>) |
| Список | pgsql-bugs |
On Wed, 23 Apr 2008, valgog wrote:
> Is it possible to implement the setStatementTimeout() as somethig
> like:
>
> s = c.prepareStatement("SELECT set_config('statement_timeout',
> <neededTimeoutInMilliseconds>, false);" );
> s.executeQuery();
> c.commit();
>
Not really. This sets a global timeout for all queries while the JDBC API
specifies that it is per-Statement. Also this only protects against long
running queries. Recently there was some discussion on the JDBC list
about soft vs hard timeouts and it seemed the conclusion was that people
wanted setQueryTimeout to protect against things like the network
connection dropping that statement_timeout can't do.
In many cases statement_timeout is an adequate substitute for
setQueryTimeout, but not in the general case that the JDBC driver must
implement.
Kris Jurka
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера