Deadlocks - DBMS Questions and Answers

1.

What are the ways of dealing with deadlock?

   A.) Deadlock prevention
   B.) Deadlock recovery
   C.) Deadlock detection
   D.) All of the mentioned

Answer: Option 'D'

Deadlock prevention is also called as deadlock recovery. Prevention is commonly used if the probability that the system would enter a deadlock state is relatively high; otherwise, detection and recovery are more efficient.

2.

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). This is

   A.) Wait-die
   B.) Wait-wound
   C.) Wound-wait
   D.) Wait

Answer: Option 'A'

The wait–die scheme is a non-preemptive technique.

3.

Selecting the victim to be rollbacked to the previous state is determined by the minimum cost. The factors determining cost of rollback is

   A.) How long the transaction has computed, and how much longer the transaction will compute before it completes its designated task
   B.) How many data items the transaction has used
   C.) How many more data items the transaction needs for it to complete
   D.) All of the mentioned

Answer: Option 'D'

We should roll back those transactions that will incur the minimum cost.

4.

The situation where the lock waits only for a specified amount of time for another lock to be released is

   A.) Lock timeout
   B.) Wait-wound
   C.) Timeout
   D.) Wait

Answer: Option 'A'

The timeout scheme is particularly easy to implement, and works well if transactions are short and if longwaits are likely to be due to deadlocks.

5.

The deadlock in a set of a transaction can be determined by

   A.) Read-only graph
   B.) Wait graph
   C.) Wait-for graph
   D.) All of the mentioned

Answer: Option 'A'

Read-only graph

Deadlocks - DBMS Questions and Answers Download Pdf