An example needed for Serializable conflict...

Поиск
Список
Период
Сортировка
От Durumdara
Тема An example needed for Serializable conflict...
Дата
Msg-id 9e384ef60907020252v5f6da06cn9afeaa5dd45ad3cf@mail.gmail.com
обсуждение исходный текст
Ответы Re: An example needed for Serializable conflict...
Список pgsql-general
Hi!

Please send me an example (pseudo-code) for Serializable conflict.
And I wanna know, if possible, that if more transactions only read the tables in Serializable mode, and one or others write to it, can I got some conflicts in read operation?

c = client t = transaction

c1t1 begin serial
c1t1 select sum(netto) from order_items where order_code = 1

c2t2 begin
c2t2 insert into order_items ....

c3t3 begin serial
c3t3 select sum(netto) from order_items where order_code = 2

c2t2 commit

c4t4 begin serial
c4t4 select sum(netto) from order_items where order_code = 1

c1t1 select count(order_items)

c4t4 rollback

c1t1 rollback

c3t3 rollback

I wanna understand, which limitations I need to see in my code to avoid conflicts on "important queries" where my calculated items must be equal (like count(*) = len(fetched(*)).

Sorry for the rtfm like question, but is rather DSFE like (Do and See the F*ed Experience). So your experience needed.

Thanks for your help:
dd

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

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: 1 Sequence per Row i.e. each customer's first order starts at 1
Следующее
От: Michaël Lemaire
Дата:
Сообщение: Delete triggers order in delete cascade (pg 8.3.7).