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: How to add / remove a lock from a table?

Re: How to add / remove a lock from a table?

From: Zoran Marjanski <zoranm_at_sympatico.ca>
Date: Wed, 21 Mar 2001 22:13:35 GMT
Message-ID: <jI9u6.17092$Im6.1804397@newsread1.prod.itd.earthlink.net>

Use the LOCK TABLE sql statement. Look it up in the SQL Reference manual. Use COMMIT or ROLLBACK to unlock the table lock.

But this LOCKS the entire table. If that's what you want good. Most of the time, the builtin row level locking is sufficient.

The Oracle DB provides row level locking when updates are performed. There's no need to explicitly lock rows, usually. An UPDATE sql statement automatically locks rows that are being updated, until a COMMIT or ROLLBACK is performed. While your SQL session has rows locked for update, other SQL sessions, see the old values of the data, until you COMMIT. This is read consistency. Most modern SQL databases provide this and is nothing new.

Hope this helps.

Zoran.

"Nick Tentomas" <Ntentoma_at_CSBFACMGT.CSBFM.DAL.CA> wrote in message news:3AB8C78D.E5C22DCA_at_CSBFACMGT.CSBFM.DAL.CA...
> Hello,
>
> I am very new to Oracle so I might be asking something very simple. I
> was wondering if anybody know how to set a lock for read/write on a
> table and when I finish how to remove the lock.
>
> Thanks in advance,
>
> Nick
>
Received on Wed Mar 21 2001 - 16:13:35 CST

Original text of this message

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