0% found this document useful (0 votes)
103 views

Database Management System UNIT-2, NOTE-2: Concurrent Execution

The document discusses concurrent execution in database management systems. It allows multiple transactions to run simultaneously for improved throughput and reduced waiting times. However, this can cause consistency issues unless concurrency control schemes are implemented. Specific issues discussed include lost updates from write-write conflicts and dirty/unrepeatable reads from write-read conflicts.

Uploaded by

Sreedevi Sageesh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
103 views

Database Management System UNIT-2, NOTE-2: Concurrent Execution

The document discusses concurrent execution in database management systems. It allows multiple transactions to run simultaneously for improved throughput and reduced waiting times. However, this can cause consistency issues unless concurrency control schemes are implemented. Specific issues discussed include lost updates from write-write conflicts and dirty/unrepeatable reads from write-read conflicts.

Uploaded by

Sreedevi Sageesh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

DATABASE MANAGEMENT SYSTEM

UNIT-2, NOTE-2
CONCURRENT EXECUTION
BCA 2ND YEARS
LECTURER: SREEDEVI SAGEESH
BHARATH MATHA COLLEGE, KOPPA

1
INTRODUCTION TO CONCURRENT EXECUTION
• In the transaction process, a system usually allows
executing more than one transaction simultaneously.
This process is called a concurrent execution.
• Ensuring consistency in spite of concurrent execution
of transactions requires extra work.
• However, there are two good reasons for allowing
concurrency:
– Improved throughput and resource utilization:
– Reduced waiting time.
• The database system must control the interaction
among the concurrent transactions to prevent them
from destroying the consistency of the database. It is
achieved using Concurrency-control Schemes.
2
CONCURRENT EXECUTION
• In a multi-user system, multiple users can access
and use the same database at one time, which is
known as the concurrent execution of the
database.
– It means that the same database is executed
simultaneously on a multi-user system by different
users.
• While working on the database transactions,
there occurs the requirement of using the
database by multiple users for performing
different operations, and in that case, concurrent
execution of the database is performed.
3
Contd.

• The thing is that the simultaneous execution


that is performed should be done in an
interleaved manner, and no operation should
affect the other executing operations, thus
maintaining the consistency of the database.
• Thus, on making the concurrent execution of
the transaction operations, there occur
several challenging problems that need to be
solved.

4
Problems with Concurrent Execution
• In a database transaction, the two main
operations are READ and WRITE operations.
• So, there is a need to manage these two
operations in the concurrent execution of the
transactions as if these operations are not
performed in an interleaved manner, and the
data may become inconsistent.
• So, the following problems occur with the
Concurrent Execution of the operations:
1. Lost Update Problems (W - W Conflict)
2. Dirty Read Problems (W-R Conflict)
3. Unrepeatable Read Problem (W-R Conflict)

5
1. Lost Update Problems (W - W Conflict)

• The problem occurs when two different


database transactions perform the read/write
operations on the same database items in an
interleaved manner (i.e., concurrent execution)
that makes the values of the items incorrect
hence making the database inconsistent.

6
W-W Conflict example:
Consider the following diagram where two transactions TX and
TY, are performed on the same account A where the balance
of account A is $300.

300

250

300

400

original 250
400

7
W-W Conflict example explanation

• At time t1: Transaction TX reads the value of account A, i.e., $300


(only read).
• At time t2: Transaction TX deducts $50 from account A that
becomes $250 (only deducted and not updated/write).
• At time t3: Transaction TY reads the value of account A that will be
$300 only because TX didn't update the value yet.
• At time t4: Transaction TY adds $100 to account A that becomes
$400 (only added but not updated/write).
• At time t6: Transaction TX writes the value of account A that will be
updated as $250 only, as TY didn't update the value yet.
• At time t7: Transaction TY writes the values of account A, so it will
write as done at time t4 that will be $400. It means the value
written by TX is lost, i.e., $250 is lost.
Hence data becomes incorrect, and database sets to inconsistent.
8

You might also like