Download presentation
Presentation is loading. Please wait.
1
Transaction Properties
All operations of a transaction must be completed If not, the transaction is aborted Atomicity Permanence of database’s consistent state Consistency Data used during transaction cannot be used by second transaction until the first is completed Isolation Ensures that once transactions are committed, they cannot be undone or lost Durability Ensures that the schedule for the concurrent execution of several transactions should yield consistent results Serializability
2
A Transaction Log
3
Two concurrent transactions to update QOH
Serial execution of the two transactions
4
Lost updates
5
Transactions creating an uncommitted data problem
6
Correct execution of two transactions
Serial execution of these transactions yields the correct result
7
Another uncommitted data problem
This time the problem occurs because the rollback is completed after T2 has started.
8
Inconsistent retrievals: Retrieval during update
9
Inconsistent retrievals:
10
Database-Level Lock
11
Table-level lock
12
A Page level lock
13
A row-level lock
14
Lock Types Binary lock Exclusive lock Shared lock
Has two states, locked (1) and unlocked (0) If an object is locked by a transaction, no other transaction can use that object If an object is unlocked, any transaction can lock the object for its use Binary lock Exists when access is reserved for the transaction that locked the object Exclusive lock Exists when concurrent transactions are granted read access on the basis of a common lock Shared lock
15
Using a binary lock
16
Figure 10.7 - Two-Phase Locking Protocol
17
Table 10.13 - How a Deadlock Condition is Created
18
Table 10.14 - Wait/Die and Wound/Wait Concurrency Control Schemes
19
Transaction recovery example
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.