Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Types of locks in database ?

Answer Posted / mahesh reddy g

lockmodes:
EXCLUSIVE
SHARE
ROW EXCLUSIVE
SHARE ROW EXCLUSIVE
ROW SHARE* | SHARE UPDATE*If NOWAIT is omitted Oracle
will wait until the table is available.

Several tables can be locked with a single command -
separate with commas

e.g. LOCK TABLE table1,table2,table3 IN ROW EXCLUSIVE MODE;

Default Locking Behaviour

A pure SELECT will not lock any rows.

INSERT, UPDATE or DELETE's - will place a ROW EXCLUSIVE
lock.

SELECT...FROM...FOR UPDATE NOWAIT - will place a ROW
EXCLUSIVE lock.

Multiple Locks on the same rows with LOCK TABLE

Even when a row is locked you can always perform a SELECT
(because SELECT does not lock any rows) in addition to
this, each type of lock will allow additional locks to be
granted as follows.

ROW SHARE = Allow ROW EXCLUSIVE or ROW SHARE or SHARE locks
to be granted to the locked rows.

ROW EXCLUSIVE = Allow ROW EXCLUSIVE or ROW SHARE locks to
be granted to the locked rows.

SHARE ROW EXCLUSIVE = Allow ROW SHARE locks to be granted
to the locked rows.

SHARE = Allow ROW SHARE or SHARE locks to be granted to the
locked rows.

EXCLUSIVE = Allow SELECT queries only

Although it is valid to place more than one lock on a row,
UPDATES and DELETE's may still cause a wait if a
conflicting row lock is held by another transaction.

* = Oracle 6 option included for compatibility

Is This Answer Correct ?    30 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

ERROR:Insert or update on table"accnt" violates foreign key constraints "acct_to_curr_symbol" DETAILS:KEY(accnt_curr_id)(-2)is not present in the table "curr_symbol" ......solve The Problem..

2448


Explain what is a subquery ?

1119


Why is sharding used?

939


How do I view a view in sql?

888


How do you bind variables in pl sql?

1033


How do I view an execution plan in sql?

920


What are sql commands?

933


Is sql pronounced sequel or sql?

1212


what is a unique key ? : Sql dba

1024


What is a crud api?

899


How do I make sql search faster?

936


Explain the purpose of %type and %rowtype data types with the example?

924


What is int identity in sql?

1056


What is a null value?

1080


What is user in sql?

966