SlideShare a Scribd company logo
1 of 18
Group 1
Super Star
PRESENTED TO:-
PROF.
JUNAID
Presented By:-
Faiza Hafeez
TOPIC
Concurrency Control With
Locking Methods
CONCURRENCY CONTROL
TECHNIQUE
Concurrency Control Technique to control
the interaction among concurrent
transaction
LOCK
 Lock
 Guarantees exclusive use of a data item to a current transaction
o T2 does not have access to a data item that is currently being used by T1
o Transaction acquires a lock prior to data access; the lock is released when
the transaction is complete
o Required to prevent another transaction from reading inconsistent data
 Lock manager
 Responsible for assigning and policing the locks used by the
transactions
LOCK GRANULARITY
 Indicates the level of lock use
 Locking can take place at the following levels:
o Database-level lock
• Entire database is locked
o Table-level lock
• Entire table is locked
o Page-level lock
• Entire disk page is locked
o Row-level lock
• Allows concurrent transactions to access different rows of the same
table, even if the rows are located on the same page
o Field-level lock
• Allows concurrent transactions to access the same row, as long as they
require the use of different fields (attributes) within that row
A DATABASE-LEVEL LOCKING SEQUENCE
TABLE-LEVEL LOCK
PAGE-LEVEL LOCK
ROW-LEVEL LOCK
FIELD-LEVEL LOCK
 Allows concurrent transactions to access the same row as
long as they require the use of different fields with that row
 Most flexible lock buy requires an extremely high level of
overhead
BINARY LOCKS
Has only two states: locked (1) or unlocked (0)
Eliminates “Lost Update” problem – the lock is not released until the
write statement is completed
Considered too restrictive to yield optimal concurrency conditions as it
locks even for two READs when no update is being done
INTRO
SHARED/EXCLUSIVE LOCKS
SHARED/EXCLUSIVE LOCKS
 Exclusive lock
Access is specifically reserved for the transaction that locked the
object
Must be used when the potential for conflict exists – when a
transaction wants to update a data item and no locks are currently
held on that data item by another transaction
Granted if and only if no other locks are held on the data item
 Shared lock
Concurrent transactions are granted Read access on the basis of a
common lock
Issued when a transaction wants to read data and no exclusive lock is
held on that data item
Multiple transactions can each have a shared lock on the same data item if
they are all just reading it
SHARED/EXCLUSIVE LOCKS
 Mutual Exclusive Rule
Only one transaction at a time can own an exclusive lock in the same object
 The type of lock held must be known before a lock can be granted
Three lock operations exist:
READ_LOCK to check the type of lock
WRITE_LOCK to issue the lock
UNLOCK to release the lock
A lock can be upgraded from share to exclusive and downgraded from exclusive to share
 Two possible major problems may occur
The resulting transaction schedule may not be serializable
The schedule may create deadlocks
Question...?
Concurrenty control

More Related Content

Similar to Concurrenty control

Locking and concurrency
Locking and concurrencyLocking and concurrency
Locking and concurrencyRumeysaDinsoy
 
Lock based protocols
Lock based protocolsLock based protocols
Lock based protocolsChethanMp7
 
Concurrency Control in Database Management System
Concurrency Control in Database Management SystemConcurrency Control in Database Management System
Concurrency Control in Database Management SystemJanki Shah
 
Concurrency of Issues of Distributed Advance Transaction
Concurrency of Issues of Distributed Advance TransactionConcurrency of Issues of Distributed Advance Transaction
Concurrency of Issues of Distributed Advance TransactionAbdelhafiz Khoudour
 
Overview of Concurrency Control & Recovery in Distributed Databases
Overview of Concurrency Control & Recovery in Distributed DatabasesOverview of Concurrency Control & Recovery in Distributed Databases
Overview of Concurrency Control & Recovery in Distributed DatabasesMeghaj Mallick
 
Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.Meghaj Mallick
 
Understanding Locking Mechanisms in Database Systems
Understanding Locking Mechanisms in Database SystemsUnderstanding Locking Mechanisms in Database Systems
Understanding Locking Mechanisms in Database Systemskiansahafi
 
Concurrency Control Techniques
Concurrency Control TechniquesConcurrency Control Techniques
Concurrency Control TechniquesRaj vardhan
 
Locking base concurrency control
  Locking base concurrency control  Locking base concurrency control
Locking base concurrency controlPrakash Poudel
 
Databases: Locking Methods
Databases: Locking MethodsDatabases: Locking Methods
Databases: Locking MethodsDamian T. Gordon
 
Concurrency control PPT
Concurrency control PPTConcurrency control PPT
Concurrency control PPTShushrutGupta
 
Intro to tsql unit 12
Intro to tsql   unit 12Intro to tsql   unit 12
Intro to tsql unit 12Syed Asrarali
 

Similar to Concurrenty control (20)

Locking and concurrency
Locking and concurrencyLocking and concurrency
Locking and concurrency
 
UNIT II.pptx
UNIT II.pptxUNIT II.pptx
UNIT II.pptx
 
concurrency control
concurrency controlconcurrency control
concurrency control
 
Vani dbms
Vani dbmsVani dbms
Vani dbms
 
Lock based protocols
Lock based protocolsLock based protocols
Lock based protocols
 
Chap 07 Locking.pptx
Chap 07  Locking.pptxChap 07  Locking.pptx
Chap 07 Locking.pptx
 
Dbms voc 5 unit
Dbms voc 5 unitDbms voc 5 unit
Dbms voc 5 unit
 
Concurrency Control in Database Management System
Concurrency Control in Database Management SystemConcurrency Control in Database Management System
Concurrency Control in Database Management System
 
Concurrency of Issues of Distributed Advance Transaction
Concurrency of Issues of Distributed Advance TransactionConcurrency of Issues of Distributed Advance Transaction
Concurrency of Issues of Distributed Advance Transaction
 
2 con control
2 con control2 con control
2 con control
 
Overview of Concurrency Control & Recovery in Distributed Databases
Overview of Concurrency Control & Recovery in Distributed DatabasesOverview of Concurrency Control & Recovery in Distributed Databases
Overview of Concurrency Control & Recovery in Distributed Databases
 
Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.
 
Sql server concurrency
Sql server concurrencySql server concurrency
Sql server concurrency
 
Understanding Locking Mechanisms in Database Systems
Understanding Locking Mechanisms in Database SystemsUnderstanding Locking Mechanisms in Database Systems
Understanding Locking Mechanisms in Database Systems
 
Concurrency Control Techniques
Concurrency Control TechniquesConcurrency Control Techniques
Concurrency Control Techniques
 
concurrency-control
concurrency-controlconcurrency-control
concurrency-control
 
Locking base concurrency control
  Locking base concurrency control  Locking base concurrency control
Locking base concurrency control
 
Databases: Locking Methods
Databases: Locking MethodsDatabases: Locking Methods
Databases: Locking Methods
 
Concurrency control PPT
Concurrency control PPTConcurrency control PPT
Concurrency control PPT
 
Intro to tsql unit 12
Intro to tsql   unit 12Intro to tsql   unit 12
Intro to tsql unit 12
 

Recently uploaded

MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 

Recently uploaded (20)

MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 

Concurrenty control

  • 2.
  • 5. CONCURRENCY CONTROL TECHNIQUE Concurrency Control Technique to control the interaction among concurrent transaction
  • 6. LOCK  Lock  Guarantees exclusive use of a data item to a current transaction o T2 does not have access to a data item that is currently being used by T1 o Transaction acquires a lock prior to data access; the lock is released when the transaction is complete o Required to prevent another transaction from reading inconsistent data  Lock manager  Responsible for assigning and policing the locks used by the transactions
  • 7. LOCK GRANULARITY  Indicates the level of lock use  Locking can take place at the following levels: o Database-level lock • Entire database is locked o Table-level lock • Entire table is locked o Page-level lock • Entire disk page is locked o Row-level lock • Allows concurrent transactions to access different rows of the same table, even if the rows are located on the same page o Field-level lock • Allows concurrent transactions to access the same row, as long as they require the use of different fields (attributes) within that row
  • 12. FIELD-LEVEL LOCK  Allows concurrent transactions to access the same row as long as they require the use of different fields with that row  Most flexible lock buy requires an extremely high level of overhead
  • 13. BINARY LOCKS Has only two states: locked (1) or unlocked (0) Eliminates “Lost Update” problem – the lock is not released until the write statement is completed Considered too restrictive to yield optimal concurrency conditions as it locks even for two READs when no update is being done
  • 15. SHARED/EXCLUSIVE LOCKS  Exclusive lock Access is specifically reserved for the transaction that locked the object Must be used when the potential for conflict exists – when a transaction wants to update a data item and no locks are currently held on that data item by another transaction Granted if and only if no other locks are held on the data item  Shared lock Concurrent transactions are granted Read access on the basis of a common lock Issued when a transaction wants to read data and no exclusive lock is held on that data item Multiple transactions can each have a shared lock on the same data item if they are all just reading it
  • 16. SHARED/EXCLUSIVE LOCKS  Mutual Exclusive Rule Only one transaction at a time can own an exclusive lock in the same object  The type of lock held must be known before a lock can be granted Three lock operations exist: READ_LOCK to check the type of lock WRITE_LOCK to issue the lock UNLOCK to release the lock A lock can be upgraded from share to exclusive and downgraded from exclusive to share  Two possible major problems may occur The resulting transaction schedule may not be serializable The schedule may create deadlocks