Re: Implementing setQueryTimeout()

Поиск
Список
Период
Сортировка
От Till Toenges
Тема Re: Implementing setQueryTimeout()
Дата
Msg-id 47BA9284.5050407@kyon.de
обсуждение исходный текст
Ответ на Re: Implementing setQueryTimeout()  (Oliver Jowett <oliver@opencloud.com>)
Ответы Re: Implementing setQueryTimeout()  (Oliver Jowett <oliver@opencloud.com>)
Список pgsql-jdbc
Oliver Jowett wrote:
> setQueryTimeout() is documented as:
>
>> Sets the number of seconds the driver will wait for a Statement object
>> to execute to the given number of seconds. If the limit is exceeded,
>> an SQLException is thrown.
>
> That would seem to cover any sort of delay, not just "it is a slow query
> on the server side". If the Statement can't execute in N seconds, return
> an error. That could mean slow network - slow query - whatever.
>
> I don't see why clients that want timeouts care about the cause of the
> slowness -  all they care about is that they get control back within
> some reasonable amount of time, surely? What's the use case where you
> would use setQueryTimeout() but don't actually mean "give me control
> back in N seconds"?

The documentation is unclear. But i think it is intended to limit the
execution time on the server.

And i do care about the cause of the slowness. If i call
setQueryTimeout(), i expect to be able to use the connection after a
timeout, including everything i had SET before, prepared statements etc.
A network timeout or anything worse is handled in an entirely different
part of the code. That is not the responsibility of the driver, and
doesn't event need to be part of the database related code at all.



Till

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: AbstracJdbc2ResultSet getColumnIndex throws missing column when using with Hibernate
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: Implementing setQueryTimeout()