Re: Deadlocks and transactions

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Deadlocks and transactions
Дата
Msg-id CAKFQuwbDhLKE-kp_MDHZMerXb3uPWFhduPOfmL4B5nBfLLSQVg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Deadlocks and transactions  (JORGE MALDONADO <jorgemal1960@gmail.com>)
Список pgsql-novice
On Tue, Mar 20, 2018 at 5:10 PM, JORGE MALDONADO <jorgemal1960@gmail.com> wrote:
My application is a website.

Let´s suppose the following scenario.
* User 1 has already loaded a web page and clicks a button that triggers a transaction that includes 2 tables.
* User 2 loads the same page and SELECTs data from the 2 tables currently in the transaction generated by User 1. User 2 does not trigger a transaction because he/she only gets data from the DB.

​Well, if you want a consistent point-in-time picture of the data in those two tables you should probably perform the selects in a transaction too.​

Is there any issue/problem for User 2?

MVCC mechanics eliminate the possibility of deadlocking between update queries and select queries (not select-for-update though).  Because of it deadlocking is only possible between two updating transactions.


(Is it correct to reply-to-all when posting back to a question?)

​Yes, reply-to-all is preferred; top-posting replies is not.  Please inline or bottom-post (and trim quoting) as appropriate.​

David J.

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

Предыдущее
От: JORGE MALDONADO
Дата:
Сообщение: Re: Deadlocks and transactions
Следующее
От: David Rowley
Дата:
Сообщение: Re: Deadlocks and transactions