Re: strange (maybe) behaviour of table lock

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: strange (maybe) behaviour of table lock
Дата
Msg-id 6530.1165596492@sss.pgh.pa.us
обсуждение исходный текст
Ответ на strange (maybe) behaviour of table lock  (Edoardo Panfili <edoardo@aspix.it>)
Ответы Re: strange (maybe) behaviour of table lock  (Edoardo Panfili <edoardo@aspix.it>)
Список pgsql-general
Edoardo Panfili <edoardo@aspix.it> writes:
> I have a servlet that uses connection pools.
> The servlet do "LOCK table,table2,table3,table4"
> then do some select (I am testing the code, I will put the update in the
> future) an then I close instruction and connection.
> The first 4 executions of the servlet goes well, the 5th hangs.
> Afther that I use "psql" to do the last query (the one that hangs the
> system) of the servlet, also psql hangs.

Look into the pg_locks view to find out what it's blocked on.  Note that
LOCK by default gets an ACCESS EXCLUSIVE lock, which means it will be
blocked by *any* pre-existing access, even an open transaction that
merely read the table awhile back.  Are you sure you really need such a
strong lock?

            regards, tom lane

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

Предыдущее
От: Csaba Nagy
Дата:
Сообщение: Re: Re: Male/female
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Male/female