Difficulty: Easy
Correct Answer: Serializable
Explanation:
Introduction / Context:
Designing for correctness often means choosing an isolation level that disallows concurrency anomalies. This question asks which level blocks all three classic anomalies.
Given Data / Assumptions:
Concept / Approach:
Serializable is the strictest isolation level, ensuring the outcome is equivalent to some serial (one-at-a-time) execution order. As a result, dirty reads, nonrepeatable reads, and phantom reads are all prevented by ensuring appropriate locking or versioning semantics.
Step-by-Step Solution:
Verification / Alternative check:
Check DBMS docs: Serializable isolation uses range locks or predicate locking (or MVCC rules) to eliminate phantoms and other anomalies.
Why Other Options Are Wrong:
They permit at least one of the anomalies listed and thus do not satisfy the requirement.
Common Pitfalls:
Assuming repeatable read blocks phantoms in all engines; typically only serializable does.
Final Answer:
Serializable
Discussion & Comments