An example needed for Serializable conflict...

From: Durumdara <durumdara(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: An example needed for Serializable conflict...
Date: 2009-07-02 09:52:31
Message-ID: 9e384ef60907020252v5f6da06cn9afeaa5dd45ad3cf@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michaël Lemaire 2009-07-02 09:56:50 Delete triggers order in delete cascade (pg 8.3.7).
Previous Message Scott Marlowe 2009-07-02 09:35:57 Re: 1 Sequence per Row i.e. each customer's first order starts at 1