Transaction Management and Con Currency
Transaction Management and Con Currency
Concurrency
Control
Learning Objectives
ROLLBACK
Establishes the order in which the operations are executed within concurrent transactions
Interleaves the execution of database operations to ensure serializability and isolation
of transactions
Based on concurrent control algorithms to determine the appropriate order
Creates serialization schedule
Serializable schedule: Interleaved execution of transactions yields the same results as
the serial execution of the transactions
Concurrency Control with Locking Methods
Lock Granularity
Indicates the level of lock use
Levels of locking
Database-level lock
Table-level lock
Page-level lock
Page or diskpage: Directly addressable section of a disk
Row-level lock
Field-level lock
Figure 10.4 - An Example of a TableLevel Lock
Figure 10.6 - An Example of a RowLevel Lock
Deadlocks
Occurs when two transactions wait indefinitely for each other to unlock data
Known as deadly embrace
Control techniques
Deadlock prevention
Deadlock detection
Deadlock avoidance
Choice of deadlock control method depends on database environment
Time Stamping
Assigns global, unique time stamp to each transaction
Produces explicit order in which transactions are submitted to DBMS
Properties
Uniqueness: Ensures no equal time stamp values exist
Monotonicity: Ensures time stamp values always increases
Concurrency Control with Optimistic Methods