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: Adrian Hands <AHands_at_sprynet.com>
Date: Tue, 19 May 1998 21:13:49 -0400
Message-ID: <35622E4D.C641DA94@sprynet.com>


> UPDATE T set COUNTER = COUNTER+1 where NAME = 'value';
> SELECT MAX(COUNTER) into :my_var FROM T where NAME = 'value';

That's no solution:

Client #1 updates the counter to 100
Client #2 updates the counter to 101
Client #1 selects 101
Client #2 selects 101

oops!

The sequence/serial... solution is best, but it looses points for not being portable.

You could put a unique index on the table being updated/inserted, check for failures and retry, but watch out for deadlocks. Received on Tue May 19 1998 - 20:13:49 CDT

Original text of this message

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