Week 1-Session 1
Week 1-Session 1
Week 1-Session 1
This includes:
• Data stored in database
• Database server
• Database management system (DBMS)
• Other database workflow applications
• Database security is generally planned, implemented
and maintained by a database administrator and or
other information security professional.
What is Concurrency ?
• Other users can read the file, but may not edit data.
Problems caused by concurrency
• For example, when one user is changing data
but has not yet saved (committed) that data,
then the database should not allow other
users who query the same data to view the
changed, unsaved data. Instead the user
should only view the original data.
Potential problems of Concurrency
• Lost Updates occur when multiple transactions select the same row
and update the row based on the value selected
• However, there is only one seat left in for the movie show in that
particular theatre. Without concurrency control, it is possible that
both moviegoers will end up purchasing a ticket.
• But concurrency control only provides a ticket to the buyer who has
completed the transaction process first.
Concurrency Control Protocols
• Lock-Based Protocols
• Two Phase
• Timestamp-Based Protocols
• Validation-Based Protocols
Lock-based Protocols
• This lock signifies that operations that can be performed on the data item.
• Locks help synchronize access to the database items by concurrent transactions.
• Binary Locks: A Binary lock on a data item can either locked or unlocked states.
• With the shared lock, the data item can be shared between
transactions.
• With the Exclusive Lock, a data item can be read as well as written.
• This is exclusive and can't be held concurrently on the same data item.
• Transactions may unlock the data item after finishing the 'write' operation.
• QUESTIONS ????