Exercise Transaction Management System
Exercise Transaction Management System
a. Airline transaction
b. ATM transaction
3. What are elements of transaction properties. Give your explanation for each element.
a. Atomic : either all the work in the transaction is completed or nothing is done
b. Consistent: database must be consistent before and after a transaction
c. Isolated: no unwanted interference from other users. A transaction should never
overwrite changes made by another transaction
d. Durable: database changes are permanent after the transaction completes
Service characteristics
o Transparent: inner details of transaction services are invisible
o Consume significant resources eg memory, disk space to improve performance
o Significant cost component: DBMSs that support large numbers of concurrent
users can be costly
o Transaction design is important: poor design can lead to performance problems
1. Locking method
a. Lock Granularity
b. Lock types
c. Two-Phase locking to ensure serializability
d. Deadlocks
2. Time stamping method
a. Wait/Die and Wound/Wait Schemes
3. Optimistic method
a. Read phase, Validation phase and Write phase
- Locking method are one of the most common techniques used in concurrency control
because they facilitate the isolation of data items used in concurrently executing
transactions. A lock guarantees exclusive use of a data item to a current transaction.
In other words, transaction T2 does not have access to a data item that is currently
being used by transaction T1. A transaction acquires a lock prior to data access, the
lock is released(unlocked) when the transaction is completed so that another
transaction can lock the data item for its exclusive use. This series of locking actions
assumes that concurrent transactions might attempt to manipulate the same data
item at the same time. The use of locks based on the assumption that conflict
between transactions is likely is usually referred to as pessimistic locking.