- 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
How are locks used in DBMS?
In a transaction, a data item which we want to read or write should first be locked before any read or write operation. After the operation is over, the transaction unlocks the data item so that other transactions can lock that same data item for their use.
Let us see how locking mechanisms help us to create error free schedules.
An erroneous schedule is as follows −
Here t2 reads A, before A is modified in T1. This will result in inconsistency.
Now we use locking mechanism in the above schedule which is shown below −
Until T1 performs Unlock(A) T2 cannot access A. So, the inconsistency is removed automatically, and the schedule becomes a correct schedule. The use of locks helps to create a correct concurrent schedule.
- Concurrency Control Using Locks in DBMS
- What are the most used SQL clauses in DBMS?
- Deadlock with mutex locks
- How can I see global locks in MySQL (innodb)?
- What are the DDL commands in DBMS?
- What are the DML commands in DBMS?
- What are the DCL commands in DBMS?
- What are the TCL commands in DBMS?
- What are different hashing methods in DBMS?
- What are the components of DBMS?
- What are the applications of DBMS?
- What are collision avoidance techniques(DBMS)?
- How are anonymous (inner) classes used in Java?
- What are the capabilities of DBMS and why relational DBMS is powerful?
- How are decision trees used for classification?