Table of Contents

About

Dirty reads is a phenomena (data problem) that occurs when a transaction reads uncommitted data in another transaction.

Dirty read can not provide read consistency.

Dirty reads

  • compromise data integrity,
  • violate foreign keys,
  • and ignore unique constraints.

Example

To illustrate a problem with dirty reads, suppose:

  • one transaction updates a column value without committing.
  • a second transaction reads the updated and dirty (uncommitted) value.
  • the first session rolls back the transaction so that the column has its old value,
  • but the second transaction proceeds using the updated value, corrupting the database.