Re: Theoretical Basis for SELECT FOR UPDATE

From: vc <boston103_at_hotmail.com>
Date: 30 Sep 2005 08:32:12 -0700
Message-ID: <1128094332.876823.68570_at_g47g2000cwa.googlegroups.com>


Tony Andrews wrote:
> vc wrote:

[...]
> > This statement is unclear. Please elaborate on "integrity to be
> > maintained at statement boundaries". The only way for a set of
> > transactions to behave in a consistent way is to be SERAILIZABLE (not
> > to be confused with serial execution).
>
> It means that after any executable statement that changes the data, the
> data is is a valid state - i.e. each executable statement IS a
> transaction. The TTM therefore requires it to be possible to combine
> multiple operations into a single statement. i.e. instead of:
>
> update account set bal=bal+10 where ac_no=123;
> update account set bal=bal-10 where ac_no=456;
> commit;
>
> TTM would have something more like:
>
> update account set bal=bal+10 where ac_no=123,
> update account set bal=bal-10 where ac_no=456;
>
> (Note the comma rather than semi-colon on line 1).
>

But that's just a syntactical difference because S1;S2;commit; is another way of saying S,S; (or vice versa).

> The important difference is that in the TTM version there is no time
> when even this transaction can see data that is in an inconsistent
> state.
>

Time is immaterial. How do two atomic writes with a pause in between, however small, can avoid inconsistency slipping in ?

> That is my understanding of the TTM position, I hope I have it right.
Received on Fri Sep 30 2005 - 17:32:12 CEST

Original text of this message