1/26
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
lock
A _____ in DBMS controls concurrent access, allowing only one
transaction to use a data item at a time. This ensures data integrity
and prevents issues like lost updates or dirty reads during
simultaneous transactions.
Lock Based Protocol
________ in DBMS ensure that a
transaction cannot read or write data until it gets the
necessary lock
Shared Lock
is also known as Read-only lock
Shared Lock
As the name suggests it can be shared between transactions because while holding this lock the transaction does not have the permission to update data on the data item
lock-S instruction.
lock S is requested using ____
Exclusive Lock
Data item can be both read as well as written. This is Exclusive and cannot be held simultaneously on the same data item.
lock-X instruction
X-lock is requested using ____
True
True / False
If a Transaction has a Read lock on a data item, it can read the item but not update it.
False
True/False
If a transaction has a Read lock on the data item, other transaction can obtain Read Lock on the data item including Write Locks.
True
True/False
If a transaction has a write Lock on a data item, it can both read and update the data item.
False
True/False
If a transaction has a write Lock on the data item, then other transactions can obtain either a Read lock or write lock on the data item.
Exclusive Lock
the Write Lock is also known as
Shared Lock
Read lock is also known as
shared locks
Multiple transactions can hold _____ on the same data item simultaneously
exclusive lock
If a transaction holds an _____ on a data item, no other transaction can hold any type of lock on that item.
Concurrency Control Protocol
are the methods used to manage
multiple transactions happening at the same time. They ensure that
transactions are executed safely without interfering with each other,
maintaining the accuracy and consistency of the database.
data conflicts, lost updates or inconsistent data
These protocols prevent issues like _____, _____ or _____by controlling how transactions access and modify data.
Simplistic Lock Protocol
Pre Claiming Lock Protocol
Two Phase Locking Protocol
Strict Two Phase Locking Protocol
Types of Lock-Based Protocols
Simplistic Locking Protocol
It is the simplest method for locking data during a transaction
Simplistic Lock Protocol / Simple Lock Based Protocol
enable all transactions to obtain a lock on the data before inserting,
deleting, or updating it. It will unlock the data item once the transaction is
completed.
Pre Claiming Lock Protocol
avoids deadlocks by requiring a
transaction to request all needed locks before it starts. It runs only if all
locks are granted; otherwise, it waits or rolls back.
Two Phase Locking Protocol
A transaction is said to follow the Two-Phase Locking protocol if Locking
and Unlocking can be done in two phases: Growing Phase and Shrinking Phase
Growing Phase
New locks on data items may be acquired but none can be released.
Shrinking Phase
Existing locks may be released but no new locks can be acquired.
Strict Two-Phase Locking
_____ requires that in addition to the 2-PL all
Exclusive(X) locks held by the transaction be released until after the
Transaction Commits.
Deadlock
both transactions are waiting for resources held by the
other, preventing either from proceeding with their execution.
Starvation
_____ is also possible if concurrency control manager is badly designed. For example: A transaction may be waiting for an X-lock on an item, while a sequence of other transactions request and are granted an S-lock on the same item. This may be avoided if the concurrency control manager is properly designed.