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

Home -> Community -> Usenet -> c.d.o.server -> Re: C/S Concurrency issue

Re: C/S Concurrency issue

From: <cmohan_at_iname.com>
Date: 1998/05/12
Message-ID: <6jaheo$8dn$1@nnrp1.dejanews.com>#1/1

Modify your SELECT statement to have the clause 'FOR UPDATE OF column', which will apply a lock on the row. Once you update and commit, the other query will see the new value!

Good luck,
CM

In article <3557D8C7.3FB1FDC4_at_kersur.net>,   hoellein_at_kersur.net wrote:
>
> Our C/S system requires a unique id for each top-level object inserted
> into a table. We're using ODBC and are trying to stay fairly generic in
> our code, so we are maintaining the current id ourselves and
> incrementing as we insert new records.
>
> Currently we SELECT the current id value, then UPDATE it to increment it
> for the next time. We have the problem of Client #1 obtaining the
> current value of N, but before it can UPDATE it to N+1, Client #2 also
> obtains the id of N. How can we insure that only one client will get a
> given value, without any other client getting it before the UPDATE
> occurs?
>
> Thanks in advance!
>
> Don Hoellein
> Mantra Software Corp.
>

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading Received on Tue May 12 1998 - 00:00:00 CDT

Original text of this message

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