Should there be a Transaction for Read Queries?

So you get a consistent view of the database. Imagine you have two tables that link to each other, but for some reason you do 2 selects… in pseuodocode:

myRows = query(SELECT * FROM A)
moreRows = query(SELECT * FROM B WHERE a_id IN myRows[id])

If between the two queries, someone changes B to delete some rows, you’re going to have a problem.

Leave a Comment