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: Concurrency and consistency - Please help me.

Re: Concurrency and consistency - Please help me.

From: Ryan Gaffuri <rgaffuri_at_cox.net>
Date: 23 Apr 2003 04:16:13 -0700
Message-ID: <1efdad5b.0304230316.3cdc5e67@posting.google.com>


sherlock_at_mailmetoday.com (Sherlock) wrote in message news:<4d1a3c52.0304222001.619241d2_at_posting.google.com>...
> Hello everyone,
>
> I am a student from Purdue University and was going through "Data
> Concurrency and Consistency" chapter from the Oracle manual. I am not
> able to comprehend the concepts after 2 days of a hard struggle. The
> reason is that Oracle explains a lock something like this:
> ---------------------------------------------------------------------------
> Share Table Locks(S)
> A share table lock is acquired automatically using the following
> statementy
> LOCK TABLE IN SHARE MODE
> Permitted Operations: Other transactions allowed to query,.......
> Prohibited Operation LOCK TABLE IN EXCLUSIVE MODE not permitted....
> ---------------------------------------------------------------------------
> Without a proper example on why and when i need to specify this, this
> really goes above me. Why for example should i use Share Table Lock
> and not an Shared Row Exclusive table lock?.
> If some kind soul can give me some hints on why these locks are used,
> i would be very much thankful. I am fairly familiar with Oracle
> (SQL,PLSQL, Normalization) and know what isolation levels (Read
> Committed, Serializable etc. )are. I am aware that Oracle uses row
> level locking and no explicit locking is needed most of the time. What
> i need is a little example on when each type of lock would prove
> useful (Some kind of a context would be great).
>
> The locks i need an example are
> 1)Row Share Table Lock
> 2)Row Exclusive Table Lock
> 3)Share Table Lock
> 4)Share Row Exclusive Table lock
> 5)Exclusive Table Locks
>
> Sorry for the length of the mail. I hope someone can throw some light
> on this.
>
> Best Wishes
> Karthik

Oracle docs are lousy for this kind of thing, though very good for other stuff. One thing to point out. This level of locking is fairly generic. It dates back to the 1960s actually. Though its advanced since then its still based on the same principles. I dug into locks in Sun Solaris a little bit and its basically the same thing. Same terminology. Now Oracle is more robust, but the principles are the same.

My suggestion is do a search on the web and on here for those types of locks. Dont worry if its Oracle or not. Im willing to be its similiar across the board. Now Oracle handles 'locking' itself in superior way than other databases, but they are simply using the principles of locking in a superior fashion.

Your professor is using the Oracle documents as learning material? That's silly. There is a very well respected Database Theory book called 'Database System Concepts'. Im reading it right now. Go there. Its made for Junior/Senior level Computer Science students. All locks are explained in there in good detail. That book is expensive, but Id bet its in the Purdue library.

Vendor specific stuff for 'locking' is not a good place to start. Your not going to get a real understanding.

Also look at Thomas Kyte, Expert One on One and Beginning Oracle Programmer(he had co-authors.) Excellent explanations of lockign and concurrency there. Kyte book probably wont be in your library, but you can grab it and sit in a chair and read it the parts you need.

Trust me, if you go to other sources you will learn alot faster than just looking at the Oracle docs. Ive been where you are now. Received on Wed Apr 23 2003 - 06:16:13 CDT

Original text of this message

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