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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Concurrency in Stored Procedure

Re: Concurrency in Stored Procedure

From: Mark G <markag_at_wonderstats.com>
Date: 2000/08/08
Message-ID: <F4155D9F9AA4D111B9990020AFBA52D53E465B@class06.ip061.sfi-software.com>#1/1

Mike,

Examine http://technet.oracle.com/docs/products/oracle8i/doc_index.htm and search "row-level locking".

Lots of info.

"Michael Maddox" <mikemad_at_earthlink.net> wrote in message news:TjYj5.30710$Z6.816176_at_newsread1.prod.itd.earthlink.net...
> I have some code similar to the following in an Oracle Stored Procedure:
>
> Select TotalCash into v_TotalCash from Account Where Account ID = 100;
>
> ..... Some verification code
>
> Update Account Set TotalCash = v_TotalCash + p_AddedCash;
>
>
> I believe this is a concurrency issue because it's possible that after
> v_TotalCash is read, someone may update the value of TotalCash in the
> Account table by the time I get to my update command. Therefore, TotalCash
> would be wrong. This would be a better solution:
>
> Update Account Set TotalCash = TotalCash + p_AddedCash;
>
> My question is, is this the only way to resolve a concurrency issue like
> this on Oracle since I don't think it does any kind of read locking?
>
> Thanks for the help!
>
> Michael Maddox
>
>
>
>
>
Received on Tue Aug 08 2000 - 00:00:00 CDT

Original text of this message

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