Re: BUG #1459: Connection hangs when other connection is not committed

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: BUG #1459: Connection hangs when other connection is not committed
Дата
Msg-id 200502041515.00657.peter_e@gmx.net
обсуждение исходный текст
Ответ на BUG #1459: Connection hangs when other connection is not committed  ("Rainer Frey" <rainer.frey@inxmail.de>)
Ответы Re: BUG #1459: Connection hangs when other connection is not  (Oliver Jowett <oliver@opencloud.com>)
Список pgsql-bugs
Am Freitag, 4. Februar 2005 11:54 schrieb Rainer Frey:
> Thanks for the explanation, though I don't really get the necessity of a
> commit for a read-only statement. Can't a SELECT release its lock after
> it received the response?

If that is the end of the transaction, then you might as well commit it then.
But what if you plan to do an update in the same transaction based on the
selection results?  You can't release and reaquire locks in the same
transaction without getting into a bunch of trouble.  Read up on "strict
two-phase locking" if you're curious.

> Is there any possibility to set a timeout for the lock, after which the
> ALTER TABLE statement fails, instead of remaining in wait status (when
> calling with JDBC?

Yes, there is a statement_timeout parameter or something like that.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: BUG #1459: Connection hangs when other connection is not committed
Следующее
От: "Prabin Gade"
Дата:
Сообщение: BUG #1461: pg_restore fails to authenticate on win