Re: Theoretical Basis for SELECT FOR UPDATE

From: <peter.koch.larsen_at_gmail.com>
Date: 4 Oct 2005 02:15:21 -0700
Message-ID: <1128417321.476873.115090_at_g14g2000cwa.googlegroups.com>


Tony Andrews skrev:

[snip]

> No, the comma operator has nothing to do with other, concurrent
> transactions really. It has to do with making the transaction atomic
> *from the perspective of the session performing the operation*. Gene
> has already given a good example about printing information half-way
> through the transaction; that might look like this:
>
> update account set bal=bal+10 where ac_no=123;
> call print_total_balance_for_all_accounts;
> update account set bal=bal-10 where ac_no=456;
> commit;
>
> The TTM version would make it impossible to print the intermediate
> total (which would be 10 higher than it should be).

Would it now?

update account set bal=bal+10 where ac_no=123, call print_total_balance_for_all_accounts, update account set bal=bal-10 where ac_no=456;

(Notice commas have replaced semicolons).

/Peter Received on Tue Oct 04 2005 - 11:15:21 CEST

Original text of this message