0% found this document useful (0 votes)
231 views6 pages

Concurrency Problems in Transaction

There are several concurrency problems that can occur with uncontrolled concurrent transactions: 1) The lost update problem occurs when one transaction updates a record that was also updated by another transaction, losing the first transaction's update. 2) The uncommitted dependency problem happens when a transaction uses data that was updated by another uncommitted transaction. 3) The inconsistent analysis problem arises when one transaction sees different versions of the same data from multiple reads, resulting in an incorrect analysis.

Uploaded by

Ehtesham Mazhar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
231 views6 pages

Concurrency Problems in Transaction

There are several concurrency problems that can occur with uncontrolled concurrent transactions: 1) The lost update problem occurs when one transaction updates a record that was also updated by another transaction, losing the first transaction's update. 2) The uncommitted dependency problem happens when a transaction uses data that was updated by another uncommitted transaction. 3) The inconsistent analysis problem arises when one transaction sees different versions of the same data from multiple reads, resulting in an incorrect analysis.

Uploaded by

Ehtesham Mazhar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Concurrency Problems in Transaction

Several problems can occur when concurrent transactions execute in an uncontrolled manner.
Some Concurrency Problems in transaction are :

The Lost Update Problem

The uncommitted dependency problem/The Temporary Update (or Dirty


Read) Problem

The inconsistent analysis problem/The Incorrect Summary Problem

The Unrepeatable Read Problem

The Lost update problem


Consider the following example :

In this example

Transaction A retrieves some tuple X at time T1.

Transaction B retrieves same tuple X at time T2.

Transaction A update the tuple X at time T3.

Transaction B update the same tuple at time T4 on the base of the values
available at time T2.

Transaction As update is lost at time T4, since transaction B overwrites it.

The uncommitted dependency problem


Consider the following example :

In this example

Transaction B update the tuple at time T1.

Transaction A retrieves the same tuple X and use the updated results at time
T2.

Update (made by transaction be at time T1) is then update at time T3.

The inconsistent analysis problem


Consider the following example :

In this example, transaction A is used to find the sum of account balances and transaction B is
used to transfer an amount 20 from account 2 to account 1.

At time T1, transaction A retrives AC 1 and some becomes 50.

Transaction B retrives AC 2 at time T2. And update it at time T3 as a result


balance of AC 2 becomes 90.

Transaction retrives AC 1 at time T4 and update balance of AC 1 becomes 70.

Transaction B commits at time T6.

At time T7, transaction A retrieve AC 2 and sum becomes 140 but not 160.
The result produced by A is wrong. Hence we say that transaction A has seen
an inconsistent state.

The Unrepeatable Read Problem


Another problem that may occur is called unrepeatable read, where a transaction T reads the
same item twice and the item is changed by another transaction T between the two reads.
Hence, T receives different values for its two reads of the same item.

Another Example : Describing all the Concurrency Problems


(Including Phantom Row and Unstable Errors) :

Phantom Row and Unstable Errors : Concurrency Problems in


Transaction

You might also like