Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Help regarding Concurrency Control
Hi Vish
Essentially under v. 7 ORACLE has improved locking contention in a multi user environment by implementing row level locking by default. So locking is fairly much handled by the DBMS. In other words: you don't have to do anything!!
But, as a word of warning you need to avoid deadlock situations in multi-user environments which arise because different applications lock rows in two (or more) tables in different orders. So develop a locking strategy so developers know the locking sequence for key tables. This problem used to be more prevalent in the days of explicit table locking, but can still prove to be a problem under v.7
Background:
ORACLE uses the concept of transaction processing, so that any transactions within commit points (punctuated by COMMIT or ROLLBACK (to savepoints if appropriate) are treated as one set of items - the effects of any UPDATE, DELETES or INSERTS are only seen by the outside world after the transaction set has been COMMITED to the database.
If a particular row is locked by another user then the user trying to affect the locked row has to wait until the row level lock has been released (when the 1st user COMMITs their transaction) - this is standard practise in RDBMS's and is not to be confused with deadlocks (mentioned above).
Hints on design:
It may be worth monitoring the database to see if locking contention is a problem in your multi-user environment - their are various V$ type 'tables' that might be useful for this.
But generally it is the job of the DBMS to ensure integrity and ORACLE seems to handle this well. In my experience, locking problems only occur because of:
Anyway, hope this helps you out. Please feel free to email me (you'll probably get a quicker response from the work email).
Regards,
These views are my own and not those of my employer. Normal conditions apply.
Vish magapu <magapuv_at_ix.netcom.com> wrote in article
<33497D86.8935CA67_at_ix.netcom.com>...
> I have a PL/SQL Procedure which has lots of inserts deletes, updates on
> multiple tables. It also has many cursors for record by record
> processing. I would like to know what steps I need to take so that
> multiple users can execute this procedure simultaneously at the same
> time so that data integrity will be protected. (I am running Oracle 7.1)
>
> Any help will be greatly appreciated.
>
> Thanks,
> Vish
>
> --------------------------------------------------------------
> Name: Vish Magapu
> E-mail: Vish Magapu <magapu_at_monet.fujitsu.com>
> Date: 04/07/97
> Time: 15:44:24
> --------------------------------------------------------------
>
>
Received on Tue Apr 08 1997 - 00:00:00 CDT