Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Avoiding any locks in SQL Servers - read and understand....its magic.
VC wrote:
> Hello Ed,
>
> "Ed Prochak" <ed.prochak_at_magicinterface.com> wrote in message
> news:RYfSb.45$rK6.32_at_fe02.usenetserver.com...
>
>>VC wrote: >> >>>Hello Ed, >>> >>>"Ed Avis" <ed_at_membled.com> wrote in message >>>news:l1isj1l2ym.fsf_at_budvar.future-i.net... >>> >>> >>>>"Heikki Tuuri" <Heikki.Tuuri_at_innodb.com> writes: >>>>Is there an example of plain SQL (not using 'if' or other PL/SQL >>>>constructs) which is not serializable in SERIALIZABLE mode? >>> >>> >>>It's a rather well-known fact that Oracle's SERIALIZABLE IL is a
>>>What Oracle calls SERIALIZABLE is, in fact, the SNAPSHOT isolation
>>>As such, it exhibits, for example, the write-skew anomaly: >>> >>>Let's assume a bank has two linked accounts for married couple with a >>>constarint X+Y >0 (the total balance should be positive). >>> >>>Further, X0 = 70 and Y0 = 80. >>> >>>Transaction T1 running in the SIL subtracts 100 from X: update x set >>>amount=amount - 100; >>>Transaction T2 running in the SIL subtracts 120 from Y (because it sees >>>X0+Y0 = 150): update y set amount = amount - 120; >>>Both transactions commit and the constarint X+Y > 0 is violated; >> >>I'd be curious how this constraint is implemented, can a constraint refer
>>two tables?
>>And by "is not serializable" I take it you mean that C2, the second
>>completes without returning an error.
-- Ed Prochak running http://www.faqs.org/faqs/running-faq/ netiquette http://www.psg.com/emily.html -- "Two roads diverged in a wood and I I took the one less travelled by and that has made all the difference." robert frostReceived on Fri Jan 30 2004 - 06:35:10 CST
![]() |
![]() |