1.

What is “Dirty read” in terms of database?

Answer»
  • Dirty read implies the meaning “read the value which may or may not be correct”. In the database, when a transaction is executing and changing some field value, at the same time another transaction comes and reads the changed field value before the first transaction could commit or rollback the value, which may cause an invalid value for that particular field. This situation is known as a dirty read.
  • Consider an example given below, where Transaction 2 changes a row but does not commit the changes made. Then Transaction 1 reads the uncommitted data. Now, if Transaction 2 GOES for roll BACKING its changes (which is already read by Transaction 1) or UPDATES any changes to the database, then the view of the data may be wrong in the RECORDS related to Transaction 1. But in this case, no row exists that has an id of 100 and an age of 25.


Discussion

No Comment Found