Skip to content

Instantly share code, notes, and snippets.

@tarun4279
Last active May 5, 2023 03:38
Show Gist options
  • Save tarun4279/7a12c914c3c18787f90f6a36dec3bd5c to your computer and use it in GitHub Desktop.
Save tarun4279/7a12c914c3c18787f90f6a36dec3bd5c to your computer and use it in GitHub Desktop.
Database Isolation Levels
isolation_level transaction_anamolies_associated solution example
Read Uncommitted Dirty Reads + Non-Repeatable Reads + Phantom Reads No solution! it allows uncommitted data to be read. For example: suppose that at the start of the transfer transaction. Alice's account has a balance of $5000 and Bob's account has a balance of $3000. Alice's transfer transaction deducts $1000 from Alice's account so her account balance becomes $4000. However the transfer transaction has not yet been committed so if Bob initiates a read transaction to check his account balance he may see a balance of $4000 instead of the correct balance of $3000.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment