177k views
2 votes
What is dirty read and how can this be avoided?

User Gillardo
by
5.0k points

1 Answer

6 votes

Answer and Explanation:

Uncommitted dependency usually called as Dirty read can be explained as a situation in which a transaction reads the value from a row that has been modified by another uncommitted transaction, and is in running.

Second transaction needs not necessarily be committed transaction in order for the initial query to return a varying result. This situation is similar to the non- repeatable reads.

Out of order appearance of the levels in the results is the only thing in the isolation of the uncommitted read which can be prevented such that earlier updates will always show up first in the result.

The dirty read can be avoided by the Read Committed isolation level of the four levels of SQL which ensures the non issuance of the shared (read) to any other transaction thus making it dirty read free.

User Vasilis Vasilatos
by
5.0k points