RDBMS Questions and Answers – Deadlock Handling

This set of RDBMS Multiple Choice Questions & Answers (MCQs) focuses on “Deadlock Handling”.

1. A system is in a _______ state if there exists a set of transactions in which every transaction is waiting for another transaction in the set.
a) Deadlock
b) Starved
c) Isolated
d) None of the mentioned
View Answer

Answer: a
Explanation: A system is in a deadlock state if there exists a set of transactions in which every transaction is waiting for another transaction in the set.

2. Which of the following is not a method in deadlock handling
a) Deadlock prevention
b) Deadlock detection
c) Deadlock recovery
d) Deadlock distribution
View Answer

Answer: d
Explanation: Deadlock distribution is not a method in deadlock handling whereas, deadlock prevention is followed by deadlock detection and deadlock recovery.

3. Deadlocks can be prevented using
a) Preemption and transaction rollbacks
b) Wait and die scheme
c) Wound-wait scheme
d) All of the mentioned
View Answer

Answer: d
Explanation: Preemption and transaction rollbacks, wait and die scheme, wound wait scheme are all different methods of deadlock prevention.
advertisement
advertisement

4. State true or false: Wait die scheme is a non-preemptive technique
a) True
b) False
View Answer

Answer: a
Explanation: The wait-die scheme is a non-preemptive technique. 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 (that is, Ti is older than Tj ). Otherwise, Ti is rolled back (dies).

5. Lock timeouts have which of the following advantages?
a) Unnecessary rollbacks do not occur
b) Transactions do not starve
c) It is easy to implement
d) All of the mentioned
View Answer

Answer: d
Explanation: In lock timeout method, unnecessary rollbacks do not occur, transactions do not starve and it is also easy to implement and is hence widely used if transactions are short and long waits are likely to be due to deadlocks.
Note: Join free Sanfoundry classes at Telegram or Youtube

6. The _________ graph describes deadlocks precisely
a) Wound wait graph
b) Wait die graph
c) Wait for graph
d) None of the mentioned
View Answer

Answer: c
Explanation: The wait for graph describes deadlocks precisely. Existence of a cycle in this graph implies that a deadlock will occur.

7. How do we generally recover from a deadlock?
a) By aborting all the transactions
b) By rolling back all the transactions
c) By rolling back only a selected number of transactions
d) None of the mentioned
View Answer

Answer: c
Explanation: We generally recover from deadlocks by rolling back only a selected number of transactions
advertisement

8. State true or false: Partial rollback is not possible.
a) True
b) False
View Answer

Answer: b
Explanation: Partial rollback is possible but it requires the system too maintain an additional amount of information on the states of the transactions.

9. Which of the following steps must be taken while choosing a victim?
a) Avoiding starvation
b) Number of transactions involved in rollback
c) Data items used by the transaction
d) All of the mentioned
View Answer

Answer: d
Explanation: While choosing a victim we much choose the one with a minimum cost. That is the one which avoids starvation, the one with the least number of transaction involved in the rollback and the one with the least amount of data items used.
advertisement

Sanfoundry Global Education & Learning Series – RDBMS.

To practice all areas of RDBMS, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.