Unit 3 Transaction Management.pptx
Unit 3 Transaction Management.pptx
(23AM3PCDBM)
• Transaction Management
■ Transaction Concept
■ Desirable Properties of Transaction
■ Serializability
■ Recoverability
■ Scheduling
Transaction Concept
• A transaction is a unit of program execution that
accesses and possibly updates various data items.
3. write(A)
4.
read(A), read(B), print(A+B)
4. read(B)
5. B := B + 50
6. write(B)
• Dirty Reads
• Nonrepeatable Reads
• Lost Update Problem
• Phantoms
Note: Transaction isolation level does not affect a
transaction's ability to see its own changes;
Dirty Reads
• A dirty read occurs when a transaction reads
data that has not yet been committed.
SQL Example – Dirty Read
Non-Repeatable Reads
• Conflicting Operations
■ Both belong to separate transactions.
■ They have the same data item
■ They contain at least one write operation
Conflict Equivalent
• Two schedules are said to be conflict equivalent if
and only if:
■ They contain the same set of the transaction.
■ If each pair of conflict operations are ordered in the same
way.
Conflict Pairs
• when two or more database transactions interact (on the same
data item) in a way that might compromise consistency or
violate serializability.
• Timestamp Ordering
• Two-Phase Locking (2PL)
• Validation Techniques
Precedence Graph Technique – Test for
Conflict Serializability
• Identify Transactions