Обсуждение: timeout for "idle in transaction"

Поиск
Список
Период
Сортировка

timeout for "idle in transaction"

От
Hannu Krosing
Дата:
Is there a way to automatically ROLLBACK transactions that are 
in "idle in transaction" for too long ?

I remember it has been discussed on this list, but what is the current
status ?

This is a problem that has haunted me on several web applicatons using 
application servers that have persistent connection (Zope, apache-php
with 
persistent connections)

-------------------
Hannu


Re: timeout for "idle in transaction"

От
Tom Lane
Дата:
Hannu Krosing <hannu@tm.ee> writes:
> Is there a way to automatically ROLLBACK transactions that are 
> in "idle in transaction" for too long ?

Nope, we don't have anything for that.  Not clear to me that it's
appropriate as a server-side function anyway.
        regards, tom lane


Re: timeout for "idle in transaction"

От
Hannu Krosing
Дата:
Tom Lane wrote:
> 
> Hannu Krosing <hannu@tm.ee> writes:
> > Is there a way to automatically ROLLBACK transactions that are
> > in "idle in transaction" for too long ?
> 
> Nope, we don't have anything for that.  Not clear to me that it's
> appropriate as a server-side function anyway.

This can't be done from the client side and we do have other types of 
deadlock detection on server side so this seems to quite appropriate 
from where I stand.

I guess it would be quite nice to have as a connection-level setting, 
so that things that benefit from it can set it to some reasonable 
value while others that want to behave unsocially  can do it as well ;)

The default could be 1-3 sec of idle time in transaction for typical 
client-server and web apps while command line clients (like psql) could 
set it to something more automatically.

-----------------
Hannu