- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Explain the main problems in concurrency control(DBMS)
Concurrency can simply be said to be executing multiple transactions at a time. It is required to increase time efficiency. If many transactions try to access the same data, then inconsistency arises. Concurrency control required to maintain consistency data.
For example, if we take ATM machines and we do not use concurrency, then multiple persons cannot draw money at a time in different places. This is where we need concurrency.
The advantages of using the concurrency control are as follows −
- Waiting time will be decreased.
- Response time will decrease.
- Resource utilization will increase.
- System performance & Efficiency is increased.
To run transactions concurrently, we interleave their operations. Each transaction gets a share of the computing time.
This leads to the following problems −
Lost update problem (write-write conflict)
Temporary update or dirty read problem (write-read conflict).
Unrepeatable read or incorrect analysis problem (read-write conflict).
All arises because isolation is broken.
Lost update problem
One transaction does some changes and another transaction deletes those changes. One transaction nullifies the updates of another transaction.
Two transactions T1 and T2 read, modify, write to the same data item in an interleaved fashion for which an incorrect value is stored in x. T2 reads the value of X before T1 changes it hence the updated value resulting from T1 is lost.
The final value of x is 15, which is incorrect.
Temporary update problem or dirty read problem
One variable has been updated in one transaction, at the same time another transaction has started and deleted the value of the variable where the variable is not getting updated or committed. That has been done on the first transaction; this gives us false values or the previous values of the variables; this is a major problem.
T2 reads the update value of X made by T1, but T1 fails and rolls back. So, T2 reads an incorrect value of X.
Unrepeatable read or incorrect analysis problem
One transaction is updating multiple different variables and another transaction is in a process to update those variables. The problem occurs is inconsistency of the same variable in different instances.
T1 consists of two parts – subtract 5 from X and add 5 to Y.
In T2, the value of X is updated but the value of Y is not updated. The sum variable stores an incorrect value. Following protocols are used to control concurrency and preserve consistency.
- Concurrency Control Using Locks in DBMS
- What is concurrency control in DBMS?
- What is an optimistic concurrency control in DBMS?
- Explain the Decidable and undecidable problems
- Explain the characteristics of DBMS?
- Explain the architecture of DBMS?
- Explain the components of DBMS?
- Explain the logical operators in DBMS
- Explain the Network Model in DBMS?
- Explain the Relational Model in DBMS?
- Explain the cardinality concept in DBMS?
- Explain the relational algebra in DBMS?
- Explain the problems for equivalence of two regular expressions.
- Explain the concept of Normalization in DBMS?
- Explain the PL/SQL Engine in DBMS