Unrepeatable Read | |||||||||||||||||||||||||||||||||||||
A dirty read problem occurs when one transaction updates a database item and then the transaction fails for some reason. | Unrepeatable read occurs when a transaction calculate some aggregate (summary) function over a set of data while other transaction are updating the data. | ||||||||||||||||||||||||||||||||||||
This problem is also known as “Un-Committed Data” | This problem is known as “Inconsistent Analysis” | ||||||||||||||||||||||||||||||||||||
The dirty read is consequence of reading updates made by a transaction before it has successfully finished | In, databases Read-Write Conflict, also known as unrepeatable reads, is a computational anomaly associated with interleaved execution of transactions. | ||||||||||||||||||||||||||||||||||||
Example :
| Example :
| ||||||||||||||||||||||||||||||||||||
Situation : Connection A reads an object that has been modified by Connection B but Connection B has not committed yet. Here, Connection B rollback transaction and uncommitted data is already read by Connection A. This is known as “Dirty Read” | Situation : Connection A performs aggregate sum of accounts, at same time Connection B modifies the database. This is resulted into Inconsistent Analysis | ||||||||||||||||||||||||||||||||||||
Problem : Transaction T2 was permitted to read the intermediate result of transaction T1 before the transaction T1 was terminated. | Problem of unrepeatable read occurs when a transaction reads a several values from database while other transaction updating those values. | ||||||||||||||||||||||||||||||||||||
Solution : Prevent T2 from reading the account balance until the transaction T1 is terminated. i.e. either committed or rollback. | Solution is prevent other transaction to read the values from the database until one transaction release it. |
Monday, March 21, 2011
Dirty Read Vs Unrepeatable Read
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment