Problem Statement
Which isolation level prevents dirty reads but may allow non-repeatable reads?
Explanation
Read Committed shows only committed data, so you avoid reading a rolled-back change. But the same row can be updated between two reads, producing a non-repeatable read.
Repeatable Read also blocks non-repeatable reads. Serializable adds protection against phantoms, at higher cost.
Code Solution
SolutionRead Only
SET TRANSACTION ISOLATION LEVEL READ COMMITTED; -- now reads see only committed rows
Practice Sets
This question appears in the following practice sets:
