Transaction · Databases
38 questions · asked in 20 of 27 years (2000–2026)
MCQ 32 · MSQ 5 · NAT 11-mark 19 · 2-mark 19
2000Questions per year2026
Questions 36–38 of 38
Which level of locking provides the highest degree of concurrency in a relational database ?
Answer: (C)
Row level locking gives the most concurrency. Different transactions can use different rows of the same table or page at the same time.
Correct Answer:
Correct Answer:
Consider three data items D1,D2 and D3 and the following execution schedule of transactions T1,T2 and T3. In the diagram, R(D) and W(D) denote the actions reading and writing the data item D respectively.
Which of the following statements is correct?
Which of the following statements is correct?
Answer: (D)
Take the operations in time order and build the precedence graph. On , writes before reads and writes it, so . On , writes before reads and writes it, so . The graph has a cycle, so the schedule is not conflict serializable.
Next, check view serializability. The cycle already shows that no order works if we look at these two conflicts, but view equivalence is a different test, so check it directly by contradiction:
Answer: (D)
Next, check view serializability. The cycle already shows that no order works if we look at these two conflicts, but view equivalence is a different test, so check it directly by contradiction:
- Initial read
reads from the initial database, and modifies . So must run before .
That is,
- Final write
In the given schedule, the final write of is done by , and also writes , that is .
This means must run after .
That is,
Answer: (D)
Which of the following scenarios may lead to an irrecoverable error in a database system?
Answer: (D)
An irrecoverable error happens when a transaction commits after reading data written by a transaction that later fails.
- (A) A transaction writes an item after another transaction has read it. The reader may get an unrepeatable read or a phantom tuple if it reads again, but it never depends on uncommitted data written by someone else. No irrecoverable error.
- (B) Both transactions only read the item. No problem.
- (C) The item was written by a transaction that has already committed, so that write will not be rolled back. No problem.
- (D) This is a dirty read. Suppose the transaction that read the uncommitted data commits, and the transaction that wrote it then fails and rolls back. The reader has committed a result based on a value that never existed, and it cannot be undone. This is an irrecoverable error.
Answer: (D)
- (A) A transaction writes an item after another transaction has read it. The reader may get an unrepeatable read or a phantom tuple if it reads again, but it never depends on uncommitted data written by someone else. No irrecoverable error.
- (B) Both transactions only read the item. No problem.
- (C) The item was written by a transaction that has already committed, so that write will not be rolled back. No problem.
- (D) This is a dirty read. Suppose the transaction that read the uncommitted data commits, and the transaction that wrote it then fails and rolls back. The reader has committed a result based on a value that never existed, and it cannot be undone. This is an irrecoverable error.
Answer: (D)
Keep practising