0% found this document useful (0 votes)
11 views5 pages

Lecture 4

The lecture discusses concurrency control in advanced database systems, focusing on resource locking as a method to prevent concurrency issues. It defines key locking terminology, including implicit, explicit, exclusive, and shared locks, as well as lock granularity levels. The document emphasizes the importance of managing access to shared data to ensure data integrity during concurrent transactions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views5 pages

Lecture 4

The lecture discusses concurrency control in advanced database systems, focusing on resource locking as a method to prevent concurrency issues. It defines key locking terminology, including implicit, explicit, exclusive, and shared locks, as well as lock granularity levels. The document emphasizes the importance of managing access to shared data to ensure data integrity during concurrent transactions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 5

CSC-313 Advanced Database Systems

Lecture 4
Concurrency
Control
By
Farah
Shaheen

Acknowledgement:
Department of Information Technology – The UniversityLecture slides material from
of Haripur
Stuart Russell
Resource Locking
 One way to prevent concurrency problems is to lock the shared
data.
 Locking ensure that the shared data can be used by one user at
one time.
 When a user accesses the data, the second user to wait until the
first user finishes its work.
 For example: There is an item in the database with a value of
100.
 If two users try to access the item to update it.

Department of Information Technology – The University of Haripur


15
Example

Department of Information Technology – The University of Haripur


16
Locking Terminology
 Some important terms:
Implicit Lock: It is a type of lock placed automatically by DBMS.
Explicit Lock: It is a type of lock placed by application program by issuing a command.
Exclusive Lock: A type of lock that locks an item from any type of access is known as
exclusive lock. If a transaction locks an item using exclusive lock, no other transaction
can read or change data.
Shared Lock: A type of lock that locks an item from change but not from read is known
as shared lock. If a transaction has locked an item using shared lock, the other transaction
can only read the item but cannot modify it.

Department of Information Technology – The University of Haripur


16
Locking Terminology
Lock Granularity: The level of the lock applied on an item is known as lock granularity.
Different levels of locks are as follows:
• Row level (Smallest lock granularity)
• Page level
• Table Level
• Database level (Largest lock granularity)
A lock with large granularity is easy to maintain for DBMS but may cause problems. A
lock with small granularity is difficult to maintain for DBMS but causes less problems.

Department of Information Technology – The University of Haripur


16

You might also like