Transaction management Flashcards
Interleaving of operations
mix (digital signals) by alternating between them.
pessimistic locking
The use of locks based on the assumption that conflict between transactions is likely.
three main transaction problems
lost updates, uncommitted data, and inconsistent retrievals
lost updates
uncommitted data
inconsistent retrievals
- Explain the following statement: A transaction is a logical unit of work.
A transaction is a sequence of database operations that access the database. A trans- action is a logical unit of work; that is, all parts are executed or the transaction is aborted. A transaction takes a database from one consistent state to another.
- What is a consistent database state, and how is it achieved?
A consis- tent database state is one in which all data integrity constraints are satisfied.
- What is a transaction log, and what is its function?
The transaction log keeps track of all transactions that modify the database. The information stored in the transaction log is used for recovery (ROLLBACK) purposes
- List the four individual transaction properties.
Transactions have four main properties: atomicity, consistency, isolation, and dura- bility.
Atomicity
Atomicity means that all parts of the transaction must be executed; otherwise, the transaction is aborted.
Consistency
Consistency means that the database’s consistent state is maintained.
Isolation
Isolation means that data used by one transaction cannot be accessed by another transaction until the first one is completed.
Durability
Durability means that changes made by a transaction cannot be rolled back once the transaction is committed
B. (2 points) What is two-phase locking (2PL)? Give an example to illustrate how deadlock may happen with two phase locking.
The two-phase locking schema has a growing phase, in which the transaction acquires all of the locks that it needs without unlocking any data, and a shrinking phase, in which the transaction releases all of the locks without acquiring new locks.