<P> There are two basic strategies used to prevent non-repeatable reads . The first is to delay the execution of Transaction 2 until Transaction 1 has committed or rolled back . This method is used when locking is used, and produces the serial schedule T1, T2 . A serial schedule exhibits repeatable reads behaviour . </P> <P> In the other strategy, as used in multiversion concurrency control, Transaction 2 is permitted to commit first, which provides for better concurrency . However, Transaction 1, which commenced prior to Transaction 2, must continue to operate on a past version of the database--a snapshot of the moment it was started . When Transaction 1 eventually tries to commit, the DBMS checks if the result of committing Transaction 1 would be equivalent to the schedule T1, T2 . If it is, then Transaction 1 can proceed . If it cannot be seen to be equivalent, however, Transaction 1 must roll back with a serialization failure . </P> <P> Using a lock - based concurrency control method, at the REPEATABLE READ isolation mode, the row with ID = 1 would be locked, thus blocking Query 2 until the first transaction was committed or rolled back . In READ COMMITTED mode, the second time Query 1 was executed, the age would have changed . </P> <P> Under multiversion concurrency control, at the SERIALIZABLE isolation level, both SELECT queries see a snapshot of the database taken at the start of Transaction 1 . Therefore, they return the same data . However, if Transaction 1 then attempted to UPDATE that row as well, a serialization failure would occur and Transaction 1 would be forced to roll back . </P>

What is dirty read in jdbc which isolation level prevents dirty read