SlideShare a Scribd company logo
3
Most read
9
Most read
12
Most read
MCA, MSc(CS), PGDCA
Pratibha Rashmi
 When many people try to make modifications
to a database at any point of time, there
should be a system of controls in place to
ensure that changes made by one do not
adversely affect the other, this is calledadversely affect the other, this is called
concurrency control.
 Concurrency control deals with interleaved
execution of more than one transaction.
 When multiple transactions execute
concurrently in an uncontrolled or
unrestricted manner, then it might lead to
several problems. Such problems are called
as concurrency problems.
concurrency problems
In transaction
Dirty Read Problem
Unrepeatable Read Problem
Phantom Read Problem
Lost Update Problem
The concurrency problems are:-
 Dirty Read Problem
 Unrepeatable Read Problem
 Phantom Read Problem
 Lost Update Problem
 Dirty Read: Reading the data written by an
uncommitted transaction is called as dirty
read.
This read is called as dirty read because-
There is always a chance that the There is always a chance that the
uncommitted transaction might roll back
later.
 Thus, uncommitted transaction might make
other transactions read a value that does not
even exist.
 This leads to inconsistency of the database.
 Dirty read does not lead to inconsistency always.
 It becomes problematic only when the
uncommitted transaction fails and roll backs
later due to some reason.later due to some reason.
Concurrency control
 Here,
T1 reads the value of A.
T1 updates the value of A in the buffer.
T2 reads the value of A from the buffer.
T2 writes the updated the value of A.
T2 commits.T2 commits.
T1 fails in later stages and rolls back.
 In this example,
1. T2 reads the dirty value of A written by the
uncommitted transaction T1.
2. T1 fails in later stages and roll backs.
3. Thus, the value that T2 read now stands to be
incorrect.
4. Therefore, database becomes inconsistent.
 This problem occurs when a transaction gets
to read unrepeated i.e. different values of
the same variable in its different read
operations even when it has not updated its
value.value.
 Here,
T1 reads the value of X (= 10 say).
T2 reads the value of X (= 10).
T1 updates the value of X (from 10 to 15 say)
in the buffer.
T2 again reads the value of X (but = 15).
 In this example,
1. T2 gets to read a different value of X in its second
reading.
2. T2 wonders how the value of X got changed
because according to it, it is running in isolation.
 This problem occurs when a transaction
reads some variable from the buffer and
when it reads the same variable later, it finds
that the variable does not exist.
 Here,
T1 reads X.
T2 reads X.
T1 deletes X.
T2 tries reading X but does not find it.T2 tries reading X but does not find it.
 In this example,
1. T2 finds that there does not exist any variable X
when it tries reading X again.
2. T2 wonders who deleted the variable X because
according to it, it is running in isolation.
 This problem occurs when multiple
transactions execute concurrently and
updates from one or more transactions get
lost.
 Here,
T1 reads the value of A (= 10 say).
T2 updates the value to A (= 15 say) in the buffer.
T2 does blind write A = 25 (write without read) in the
buffer.
T2 commits.
When T1 commits, it writes A = 25 in the database.
 In this example, In this example,
1. T1 writes the over written value of X in the database.
2. Thus, update from T1 gets lost.
NOTE-
 This problem occurs whenever there is a write-write conflict.
 In write-write conflict, there are two writes one by each
transaction on the same data item without any read in the
middle.
 To ensure consistency of the database, it is
very important to prevent the occurrence of
above problems.
 Concurrency Control Protocols help to
prevent the occurrence of above problemsprevent the occurrence of above problems
and maintain the consistency of the
database.
 If the transaction is rolled back, all the
database changes made inside the
transaction are ___________
A. made permanent
B. made temporary
C. copied to the logC. copied to the log
D. undone
 In ________ one transaction overwrites the
changes of another transaction.
A. uncommitted read problem
B. lost update problem
C. update lost problem
D. dirty read problem
 In a dirty read problem _________
A. one transaction reads an uncommitted value of another
transaction
B. one transaction reads the committed value for another
transaction
C. one transaction reads another transaction
D. one transaction commits another transaction.
C. one transaction reads another transaction
D. one transaction commits another transaction.
 Isolation of the transactions is ensured by
A. Transaction management
B. Application programmer
C. Concurrency control
D. Recovery management
 Define the term Concurrency Control.
 What is dirty read and phantom read?
 What is inconsistent read problem?
 What is the mean of write- write problem?
Reference: https://www.gatevidyalay.com/, http://beginnersbook.com
Concurrency control

More Related Content

PPTX
Unit I - Evaluation of expression
PPTX
Distributed database
PPT
358 33 powerpoint-slides_4-introduction-data-structures_chapter-4
PPTX
Transaction Properties in database | ACID Properties
PPTX
Concurrency Control in Database Management System
PPTX
Acid properties
PPT
Binary Search
PPTX
Transaction states and properties
Unit I - Evaluation of expression
Distributed database
358 33 powerpoint-slides_4-introduction-data-structures_chapter-4
Transaction Properties in database | ACID Properties
Concurrency Control in Database Management System
Acid properties
Binary Search
Transaction states and properties

What's hot (20)

PPTX
Log based and Recovery with concurrent transaction
PPTX
Input-Buffering
PPTX
Timestamp protocols
PPTX
Adbms 40 heuristics in query optimization
PPTX
Shortest job first Scheduling (SJF)
PPTX
serializability in dbms
PPTX
Dag representation of basic blocks
PPT
Top down parsing
PPT
Transactions in dbms
PPT
Binary tree
PPT
b+ tree
PPTX
sorting and its types
PPTX
A Role of Lexical Analyzer
PPTX
Insertion Sorting
PPTX
Instruction Pipelining
PPT
Bubble sort
PPTX
instruction cycle ppt
PPT
Sorting algorithms
PPTX
Chapter-7 Relational Calculus
PPTX
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
Log based and Recovery with concurrent transaction
Input-Buffering
Timestamp protocols
Adbms 40 heuristics in query optimization
Shortest job first Scheduling (SJF)
serializability in dbms
Dag representation of basic blocks
Top down parsing
Transactions in dbms
Binary tree
b+ tree
sorting and its types
A Role of Lexical Analyzer
Insertion Sorting
Instruction Pipelining
Bubble sort
instruction cycle ppt
Sorting algorithms
Chapter-7 Relational Calculus
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
Ad

Similar to Concurrency control (20)

PPT
... MongoDB, Redis and Cassandra, without physically launching a virtual mach...
PPTX
database1.pptx
PPT
transaction management, concept & State
PPTX
DBMS UNIT IV.pptx
PPTX
transcation processing the concept of dbms
PPTX
PPTX
Chapter 1 - Transaction Processing and Mgt.pptx
PPTX
Chapter 1&2 query processing and optimization - Copy.pptx
PPTX
Chapter 123 - Transaction Processing and Mgt.pptx
PPTX
DBMS_Transaction processing – Schedule –Serializable Schedule – Concurrency C...
PPT
19.TRANSACTIONs.ppt
PPTX
Concujsjsjejejejejejejerreny control.pptx
PDF
CONCURRENCY CONTOL notes.pdf
PPTX
Advanced Database System Chapter 2 Transaction.pptx
PPTX
Transactions and concurrency control mechanisms in database management system
PPTX
data base management system notes on concurrency control
PPTX
Transactions in database systems and functions
PPT
Class-Transaction Management.ppt Database
PPTX
Database management system ch1 & 2.pptx
PDF
Dbms module iii
... MongoDB, Redis and Cassandra, without physically launching a virtual mach...
database1.pptx
transaction management, concept & State
DBMS UNIT IV.pptx
transcation processing the concept of dbms
Chapter 1 - Transaction Processing and Mgt.pptx
Chapter 1&2 query processing and optimization - Copy.pptx
Chapter 123 - Transaction Processing and Mgt.pptx
DBMS_Transaction processing – Schedule –Serializable Schedule – Concurrency C...
19.TRANSACTIONs.ppt
Concujsjsjejejejejejejerreny control.pptx
CONCURRENCY CONTOL notes.pdf
Advanced Database System Chapter 2 Transaction.pptx
Transactions and concurrency control mechanisms in database management system
data base management system notes on concurrency control
Transactions in database systems and functions
Class-Transaction Management.ppt Database
Database management system ch1 & 2.pptx
Dbms module iii
Ad

More from PratibhaRashmiSingh (6)

PDF
Transaction
PDF
Schedule in DBMS
PDF
Types of normalization
PDF
Normalization
PDF
Data manipulation language
Transaction
Schedule in DBMS
Types of normalization
Normalization
Data manipulation language

Recently uploaded (20)

PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
PPTX
Cell Structure & Organelles in detailed.
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Trump Administration's workforce development strategy
PDF
Classroom Observation Tools for Teachers
PDF
Updated Idioms and Phrasal Verbs in English subject
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
master seminar digital applications in india
PDF
What if we spent less time fighting change, and more time building what’s rig...
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PDF
RMMM.pdf make it easy to upload and study
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Computing-Curriculum for Schools in Ghana
PPTX
UNIT III MENTAL HEALTH NURSING ASSESSMENT
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Practical Manual AGRO-233 Principles and Practices of Natural Farming
Cell Structure & Organelles in detailed.
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Trump Administration's workforce development strategy
Classroom Observation Tools for Teachers
Updated Idioms and Phrasal Verbs in English subject
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Supply Chain Operations Speaking Notes -ICLT Program
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
Microbial disease of the cardiovascular and lymphatic systems
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
master seminar digital applications in india
What if we spent less time fighting change, and more time building what’s rig...
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
RMMM.pdf make it easy to upload and study
Chinmaya Tiranga quiz Grand Finale.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
Computing-Curriculum for Schools in Ghana
UNIT III MENTAL HEALTH NURSING ASSESSMENT

Concurrency control

  • 2.  When many people try to make modifications to a database at any point of time, there should be a system of controls in place to ensure that changes made by one do not adversely affect the other, this is calledadversely affect the other, this is called concurrency control.  Concurrency control deals with interleaved execution of more than one transaction.
  • 3.  When multiple transactions execute concurrently in an uncontrolled or unrestricted manner, then it might lead to several problems. Such problems are called as concurrency problems. concurrency problems In transaction Dirty Read Problem Unrepeatable Read Problem Phantom Read Problem Lost Update Problem
  • 4. The concurrency problems are:-  Dirty Read Problem  Unrepeatable Read Problem  Phantom Read Problem  Lost Update Problem
  • 5.  Dirty Read: Reading the data written by an uncommitted transaction is called as dirty read. This read is called as dirty read because- There is always a chance that the There is always a chance that the uncommitted transaction might roll back later.  Thus, uncommitted transaction might make other transactions read a value that does not even exist.  This leads to inconsistency of the database.
  • 6.  Dirty read does not lead to inconsistency always.  It becomes problematic only when the uncommitted transaction fails and roll backs later due to some reason.later due to some reason.
  • 8.  Here, T1 reads the value of A. T1 updates the value of A in the buffer. T2 reads the value of A from the buffer. T2 writes the updated the value of A. T2 commits.T2 commits. T1 fails in later stages and rolls back.  In this example, 1. T2 reads the dirty value of A written by the uncommitted transaction T1. 2. T1 fails in later stages and roll backs. 3. Thus, the value that T2 read now stands to be incorrect. 4. Therefore, database becomes inconsistent.
  • 9.  This problem occurs when a transaction gets to read unrepeated i.e. different values of the same variable in its different read operations even when it has not updated its value.value.
  • 10.  Here, T1 reads the value of X (= 10 say). T2 reads the value of X (= 10). T1 updates the value of X (from 10 to 15 say) in the buffer. T2 again reads the value of X (but = 15).  In this example, 1. T2 gets to read a different value of X in its second reading. 2. T2 wonders how the value of X got changed because according to it, it is running in isolation.
  • 11.  This problem occurs when a transaction reads some variable from the buffer and when it reads the same variable later, it finds that the variable does not exist.
  • 12.  Here, T1 reads X. T2 reads X. T1 deletes X. T2 tries reading X but does not find it.T2 tries reading X but does not find it.  In this example, 1. T2 finds that there does not exist any variable X when it tries reading X again. 2. T2 wonders who deleted the variable X because according to it, it is running in isolation.
  • 13.  This problem occurs when multiple transactions execute concurrently and updates from one or more transactions get lost.
  • 14.  Here, T1 reads the value of A (= 10 say). T2 updates the value to A (= 15 say) in the buffer. T2 does blind write A = 25 (write without read) in the buffer. T2 commits. When T1 commits, it writes A = 25 in the database.  In this example, In this example, 1. T1 writes the over written value of X in the database. 2. Thus, update from T1 gets lost. NOTE-  This problem occurs whenever there is a write-write conflict.  In write-write conflict, there are two writes one by each transaction on the same data item without any read in the middle.
  • 15.  To ensure consistency of the database, it is very important to prevent the occurrence of above problems.  Concurrency Control Protocols help to prevent the occurrence of above problemsprevent the occurrence of above problems and maintain the consistency of the database.
  • 16.  If the transaction is rolled back, all the database changes made inside the transaction are ___________ A. made permanent B. made temporary C. copied to the logC. copied to the log D. undone  In ________ one transaction overwrites the changes of another transaction. A. uncommitted read problem B. lost update problem C. update lost problem D. dirty read problem
  • 17.  In a dirty read problem _________ A. one transaction reads an uncommitted value of another transaction B. one transaction reads the committed value for another transaction C. one transaction reads another transaction D. one transaction commits another transaction. C. one transaction reads another transaction D. one transaction commits another transaction.  Isolation of the transactions is ensured by A. Transaction management B. Application programmer C. Concurrency control D. Recovery management
  • 18.  Define the term Concurrency Control.  What is dirty read and phantom read?  What is inconsistent read problem?  What is the mean of write- write problem? Reference: https://www.gatevidyalay.com/, http://beginnersbook.com