Transaction Isolation on select, insert, delete
- by Bradford
What could possibly go wrong with the following transaction if executed by concurrent users in the default isolation level of READ COMMITTED?
BEGIN TRANSACTION
SELECT * FROM t WHERE pid = 10 and r between 40 and 60
-- ... this returns tid = 1, 3, 5
-- ... process returned data ...
DELETE FROM t WHERE tid in (1, 3, 5)
INSERT INTO t (tid, pid, r)…