Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Which transaction isolation level can prevent lost updates?

Re: Which transaction isolation level can prevent lost updates?

From: Pablo Sanchez <pablo_at_dev.null>
Date: Mon, 25 Nov 2002 22:24:01 GMT
Message-ID: <Xns92D19CA953C5Apingottpingottbah@209.242.64.107>


Daniel Morgan <dmorgan_at_exesolutions.com> wrote in news:3DE2943C.B7201C05 @exesolutions.com:

>> Arno Huetter wrote:

> 

>> trans 1: trans 2:
>> begin;
>> begin;
>> select i;
>> select i;
>> i = i + 1;
>> i = i + 1;
>> update i;
>> update i;
>> commit;
>> commit;
> 
> In Oracle the chances of this problem happening is so remote that I
> can't think of anyone that does anything to code around it.

It's not that remote at all. I worked on a large system that had the issue until we solved it with SELECT FOR UPDATE.

Being that the above is an example, the question is, can Arno re-write the query and embed the logic in the where clause of the update:

trans 1: tran 2:

update i=i+1

                update i=i+1

now the work is atomic.

-- 
Pablo Sanchez, High-Performance Database Engineering
http://www.hpdbe.com
Received on Mon Nov 25 2002 - 16:24:01 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US