This content has been marked as final. Show 2 replies
You could select with a lock on the table, before increasing the value "N". The only issue is that the user that first does this operation should select it and update it quite fast so that others do not wait on the lock to be realeased.
More elaboration from another Oracle person....
If the subset of rows that need to be updated is known, he could use a SELECT...FOR UPDATE WHERE <conditions> followed by an UPDATE statement. The
SELECT FOR UPDATE places locks on the rows in question. The row locks will be released, when the UPDATE is COMMITted. The window
between the SELECT FOR UPDATE and the commit will determine the concurrency.