Database Management System UNIT-2, NOTE-2: Concurrent Execution
Database Management System UNIT-2, NOTE-2: Concurrent Execution
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.
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)
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