Concurrency Control MCQ Quiz in తెలుగు - Objective Question with Answer for Concurrency Control - ముఫ్త్ [PDF] డౌన్లోడ్ కరెన్
Last updated on Mar 19, 2025
Latest Concurrency Control MCQ Objective Questions
Top Concurrency Control MCQ Objective Questions
Concurrency Control Question 1:
Consider the following statements about database transaction schedules:
Which of the below statements is/are TRUE?
Answer (Detailed Solution Below)
Concurrency Control Question 1 Detailed Solution
- Strict 2PL allows only schedules whose precedence graph is acyclic i.e. schedule is Conflict Serial.
- In 2PL, transactions do not release exclusive locks until the transaction has committed or aborted i.e. schedule is recoverable.
- Timestamp ordering schedule with Thomas write rule generate View serial schedule with BLIND WRITE. Because of BLIND WRITE it won't be Conflict Serial.
-
Two Phase locking ensures conflict serializability but does not ensure deadlock freedom. But time stamp ordering ensures both deadlock freedom and conflict serializability.
Concurrency Control Question 2:
Consider the following two-phase locking protocol. Suppose a transaction T accesses (for read or write operations), a certain set of objects {O1,…,Ok}. This is done in the following manner:
Step 1. T acquires exclusive locks to O1,…,Ok in increasing order of their addresses.
Step 2. The required operations are performed.
Step 3. All locks are released.
This protocol willAnswer (Detailed Solution Below)
Concurrency Control Question 2 Detailed Solution
A transaction is said to follow 2- phase locking protocol if locking and unlocking can be done in 2 phases:
1) Growing phase: New locks on data items may be acquired but none can be released.
2) Shrinking phase: Existing locks may be released but no new locks can be acquired.
Properties of conservative 2PL:
A 2PL schedule is serializable, strict recoverable, deadlock free, starvation free.
Here, locks are acquired in order O1, O2, O3,……….Ok (increasing order). Locks are also not released until the transaction completes its operation. Here circular wait condition can never occur. Hence, there is no possibility of deadlock.
2PL is conflict serializable. So, it guarantees serializability. We can get a serializable schedule by ordering based on lock points.Concurrency Control Question 3:
Which of the following statement is False about deadlock detection policies?
I. Wait-die scheme is a non-preemptive technique while wound-wait scheme is a preemptive technique for deadlock prevention.
II. If Ti requests a lock held by Tj and Ti is older than Tj then in wait-die scheme Ti will wait and in wound-wait scheme Tj will wait.
III There is deadlock in the system if and only if there exists a cycle in the wait-for-graph.Answer (Detailed Solution Below)
Concurrency Control Question 3 Detailed Solution
Wait – die scheme: It is a non-preemptive technique for deadlock prevention. When transaction Ti requests a data item currently held by Tj, Ti is allowed to wait only if it has a timestamp smaller than that of Tj, otherwise Ti is rolled back (dies).
If Ti requests a lock held by Tj
1. And If TS(Ti) < TS(Tj) − that is Ti, which is requesting a conflicting lock, is older than Tj then Ti is allowed to wait until the data-item is available.
2. And If TS(Ti) > TS(tj) − that is Ti is younger than Tj − then Ti dies. Ti is restarted later with a random delay but with the same timestamp.
Wound – wait scheme: t is a pre-emptive technique for deadlock prevention. It is a counterpart to the wait-die scheme. When Transaction Ti requests a data item currently held by Tj, Ti is allowed to wait only if it has a timestamp larger than that of Tj, otherwise Tj is rolled back (Tj is wounded by Ti).
If Ti requests a lock held by Tj
1. If TS(Ti) < TS(Tj), then Ti forces Tj to be rolled back − that is Ti wounds Tj. Tj is restarted later with a random delay but with the same timestamp.
2. If TS(Ti) > TS(Tj), then Ti is forced to wait until the resource is available.
Concurrency Control Question 4:
Which level of locking provides the highest degree of concurrency in a relational database?
Answer (Detailed Solution Below)
Concurrency Control Question 4 Detailed Solution
Concurrency Control Question 5:
In a strict two phase locking protocol
Answer (Detailed Solution Below)
Concurrency Control Question 5 Detailed Solution
Concurrency Control Question 6:
which of the following is false statement
Answer (Detailed Solution Below)
Concurrency Control Question 6 Detailed Solution
Concurrency Control Question 7:
Assume transaction A holds a share lock R. If a transaction B also requests for a shared lock on R.
Answer (Detailed Solution Below)
Concurrency Control Question 7 Detailed Solution
Concept:
Simple locking scheme:
1. Shared lock (S) 2. An exclusive lock (X)
Shared Lock (S): If transaction locked data item in shared mode, allowed to read-only.
Exclusive Lock (X): If transaction locked data item in shared mode, allowed to read and write both.
REQUEST |
Grant lock |
|
LOCK |
S |
X |
S |
YES |
NO |
X |
NO |
NO |
Explanation:
From the above table, we can see that if one transaction has a shared lock on a data item and if
one other transaction request for a shared lock on the same data item it will be immediately granted.Concurrency Control Question 8:
In context of two phase locking protocol, which of the following statements is correct?
Answer (Detailed Solution Below)
Concurrency Control Question 8 Detailed Solution
The correct answer is In growing phase, transaction can only obtain locks and in shrinking phase, it can only release locks.
Key PointsTwo-phase locking (2PL) is a concurrency control method that ensures serializability. It is divided into two phases:
- Growing Phase: During this phase, a transaction can only acquire or obtain locks and cannot release any locks it has already obtained. This phase allows the transaction to lock additional resources as needed but ensures that once it starts releasing locks, it cannot lock more resources. This helps prevent deadlock and ensures a strict ordering of operations.
- Shrinking Phase: After the transaction has acquired all the locks it needs, it enters the shrinking phase, where it can only release locks and cannot obtain any new locks. This phase concludes as the transaction releases all its locks, either by committing or aborting. The release of locks in the shrinking phase allows other transactions to proceed, thus facilitating concurrent access to the database while maintaining consistency and isolation.
The two-phase locking protocol guarantees conflict serializability and prevents certain types of deadlocks, although it doesn't entirely eliminate the risk of deadlocks. The strict division into growing and shrinking phases is crucial for maintaining the integrity of transactions and ensuring that the database operates consistently and correctly under concurrent access.
Concurrency Control Question 9:
Which one of the following techniques is sometimes used to solve integrity problems in a concurrent transaction scenario?
Answer (Detailed Solution Below)
Concurrency Control Question 9 Detailed Solution
The correct answer is Two-phase locking
Key Points
- Two-phase locking is a concurrency control mechanism used to ensure the consistency and integrity of a database in a concurrent transaction scenario. It involves two phases: the growing phase and the shrinking phase.
- In the growing phase, transactions can acquire locks but cannot release any.
- In the shrinking phase, transactions can release locks but cannot acquire any.
- This protocol helps in preventing issues such as lost updates, uncommitted data, and inconsistency that may arise due to concurrent execution of transactions.
Concurrency Control Question 10:
Which one of the following problems can occur due to introducing locks in a concurrent transaction scenario?
Answer (Detailed Solution Below)
Concurrency Control Question 10 Detailed Solution
The correct answer is Deadlock
Key Points
- Deadlocks occur when two or more processes hold locks on resources and each process is waiting to acquire a lock on a resource that the other process holds. None of the processes can proceed, resulting in a standoff. This is a common problem in database systems and applications where concurrency is managed through locking mechanisms.
Additional Information
- Information overwrite, loss of information, and lack of integrity are issues that locking mechanisms aim to prevent by ensuring transactions do not interfere with each other. Properly implemented locks help maintain data integrity and prevent concurrent transactions from corrupting data.