Transactions and Concurrency
A variety of implementation strategies exist to guarantee that database transactions satisfy the ACID properties. One of the simplest uses locks to prevent concurrent modification of data that has been read by a transaction. Because deadlock may ensue when when multiple transactions are waiting for the same resource(s), several protocols exist to enforce isolation among transactions while minimizing the likelihood of deadlocks.
Learning Objectives
- List the necessary conditions for deadlock
- Describe how database management systems (DBMSs) use locks to ensure isolation among transactions
- Describe the two-phase locking protocol and strict two-phase locking
- Create a serializable schedule using the aforementioned locking protocols
How to Complete this Lesson
Complete the following learning activities: (2.5–2.75 hours total)
- Read Deadlock (10–15 minutes)
- Attend the class meeting
(60 minutes)
- Complete the handout (10–20 minutes)
- Complete the project website
(75–90 minutes)
- Implement client-side validation for forms
Due
As a reminder, the following is due this lesson:
Resources
- The Transaction Model (5 minutes)
- Deadlock Scenarios and Prevention (4 minutes)
- Deadlock Avoidance (3 minutes)
- Deadlock Detection and Resolution (3 minutes)
- Two Phase Locking (4 minutes)
- Strict 2PL (2 minutes)
- Questions for database control issues (30 minutes)