1Z0-873 · Question #138
Which of the following describes how deadlocks may occur and how InnoDB resolves them?
The correct answer is B. Deadlocks happen when two transactions both have locks that the other is waiting for the release C. InnoDB resolves deadlocks by terminating and rolling back one of the deadlocking transactions. Deadlock can occur. Deadlock is a situation in which each of two transactions is waiting for the release of a lock that the other holds. For example, if two transactions each lock a different row, and then try to modify the row locked by the other, they can deadlock. Deadlock…
Question
Which of the following describes how deadlocks may occur and how InnoDB resolves them?
Options
- ADeadlocks happen anytime when more than one lock is placed in a table.
- BDeadlocks happen when two transactions both have locks that the other is waiting for the release
- CInnoDB resolves deadlocks by terminating and rolling back one of the deadlocking transactions.
- DInnoDB resolves deadlocks by terminating and rolling back both of the deadlocking transactions.
How the community answered
(14 responses)- A7% (1)
- B86% (12)
- D7% (1)
Explanation
Deadlock can occur. Deadlock is a situation in which each of two transactions is waiting for the release of a lock that the other holds. For example, if two transactions each lock a different row, and then try to modify the row locked by the other, they can deadlock. Deadlock is possible because InnoDB does not acquire locks during a transaction until they are needed. When InnoDB detects a deadlock, it terminates and rolls back one of the deadlocking transactions. It tries to pick the transaction that has modified the smallest number of rows. If InnoDB does not detect deadlock, the deadlocked transactions eventually begin to time out and InnoDB rolls them back
Topics
Community Discussion
No community discussion yet for this question.