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 6–10 of 38
Once the DBMS informs the user that a transaction has been successfully completed, its effect should persist even if the system crashes before all its changes are reflected on disk. This property is called
Answer: (A)
After a transaction commits, its changes must stay safe even if a crash happens later. The log is used for recovery. This is the Durability property of ACID.
Answer: durability
Answer: durability
Which of the following statements about the Two Phase Locking (2PL) protocol is/are TRUE?
One or more options are correct.
Answer: (A), (C), (D)
Let us go through each option:
- (A) 2PL ensures conflict serializability, so only serializable schedules are allowed: TRUE.
- (B) If a lock is taken just before each operation and freed just after it, 2PL is broken, because a lock is released and then a new lock is taken: FALSE.
- (C) A transaction has a growing phase and then a shrinking phase. After the first lock is released, no new lock can be taken (this is the definition): TRUE.
- (D) Deadlock can happen: T1 locks A, T2 locks B, and then each one waits for the lock held by the other: TRUE.
Answer: (A), (C), (D)
- (A) 2PL ensures conflict serializability, so only serializable schedules are allowed: TRUE.
- (B) If a lock is taken just before each operation and freed just after it, 2PL is broken, because a lock is released and then a new lock is taken: FALSE.
- (C) A transaction has a growing phase and then a shrinking phase. After the first lock is released, no new lock can be taken (this is the definition): TRUE.
- (D) Deadlock can happen: T1 locks A, T2 locks B, and then each one waits for the lock held by the other: TRUE.
Answer: (A), (C), (D)
Let and denote read and write operations on a data element by a transaction , respectively. Consider the schedule with four transactions.
S:
Which one of the following serial schedules is conflict equivalent to ?
S:
Which one of the following serial schedules is conflict equivalent to ?
Answer: (A)
Pairs of operations in S that conflict:
- comes before , so T4 T2
- comes before , so T3 T2
- comes before , so T1 T3
- comes before , so T1 T4
- comes before , so T3 T4
The topological order is T1 T3 T4 T2.
Answer:
- comes before , so T4 T2
- comes before , so T3 T2
- comes before , so T1 T3
- comes before , so T1 T4
- comes before , so T3 T4
The topological order is T1 T3 T4 T2.
Answer:
Suppose a database system crashes again while recovering from a previous crash. Assume checkpointing is not done by the database either during the transactions or during recovery.
Which of the following statements is/are correct?
Which of the following statements is/are correct?
One or more options are correct.
Answer: (A)
With no checkpoints, recovery always begins from the log. Idempotent means that doing undo and redo again gives the same result. So after a second crash, the system builds the same undo and redo lists from the log and applies them again.
Recovery is still possible, and the database stays consistent.
Answer: The same undo and redo list will be used while recovering again
Recovery is still possible, and the database stays consistent.
Answer: The same undo and redo list will be used while recovering again
Let and denote read and write operations respectively on a data item by a transaction . Consider the following two schedules.
Which one of the following options is correct?
Which one of the following options is correct?
Answer: (B)
S1: before gives T1 T2; before gives T2 T1. Cycle not conflict serializable.
S2: before gives T2 T1; before gives T2 T1. No cycle conflict serializable (T2, T1).
Answer: S1 is not conflict serializable, and S2 is conflict serializable
S2: before gives T2 T1; before gives T2 T1. No cycle conflict serializable (T2, T1).
Answer: S1 is not conflict serializable, and S2 is conflict serializable
Keep practising