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 -> Which transaction isolation level can prevent lost updates?

Which transaction isolation level can prevent lost updates?

From: Arno Huetter <huetter_at_grz.at>
Date: 25 Nov 2002 11:45:53 -0800
Message-ID: <a710c60d.0211251145.3f1edc69@posting.google.com>


Hello there,

I am working on a multi-tier project, using Oracle 8i. My data layer consists of container-managed entity java beans, which means that I don't have direct control over which SQL statements are being generated, hence I cannot force X-locks via dummy-updates, nor by invoking SELECT FOR UPDATE. What I can do is to set the isolation level for the transactions my entity beans will execute within. Which transaction isolation level is necessary to prevent lost updates:

trans 1: trans 2:
begin;

            begin;
select i;

            select i;
i = i + 1;

            i = i + 1;
update i;

            update i;
commit;

            commit;

I know isolation level SERIALIZABLE would circumvent lost updates for sure. But I once read that REPEATABLE READ avoids lost updates as well, yet I am not sure whether that's true...

Thank you!

Kind regards,
Arno Huetter Received on Mon Nov 25 2002 - 13:45:53 CST

Original text of this message

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