Intro To Transaction Processing and Theory
Intro To Transaction Processing and Theory
Unit 8
Introduction to Transaction Processing Concepts and Theory
Instructor
Indra Chaudhary
[email protected]
DBMS: Syllabus
2
Active – the initial state; the transaction stays in this state while it is
executing
Partially committed – after the final statement has been executed.
Failed -- after the discovery that normal execution can no longer proceed.
Aborted – after the transaction has been rolled back and the database
restored to its state prior to the start of the transaction. Two options after it
has been aborted:
restart the transaction
throughput
E.g. one transaction can be using the CPU while another is reading
from or writing to the disk
reduced average response time for transactions: short transactions need
those transactions
must preserve the order in which the instructions appear in each
individual transaction.
A transaction that successfully completes its execution will have a commit
instructions as the last statement
by default transaction assumed to execute commit instruction as its last
step
A transaction that fails to successfully complete its execution will have an
abort instruction as the last statement
Schedule 1
12
Let T1 transfer $50 from A to B, and T2 transfer 10% of the balance from A
to B.
A serial schedule in which T1 is followed by T2 :
Schedule 2
13
Schedule 3 Schedule 6
Conflict Serializability (Cont.)
21
Let S and S´ be two schedules with the same set of transactions. S and S´ are
view equivalent if the following three conditions are met, for each data item
Q,
1. If in schedule S, transaction Ti reads the initial value of Q, then in
schedule S’ also transaction Ti must read the initial value of Q.
2. If in schedule S transaction Ti executes read(Q), and that value was
produced by transaction Tj (if any), then in schedule S’ also transaction Ti
must read the value of Q that was produced by the same write(Q)
operation of transaction Tj .
3. The transaction (if any) that performs the final write(Q) operation in
schedule S must also perform the final write(Q) operation in schedule S’.
As can be seen, view equivalence is also based purely on reads and writes alone.
View Serializability (Cont.)
23
number of edges.)
If precedence graph is acyclic, the serializability
order can be obtained by a topological sorting of the
graph.
This is a linear order consistent with the partial
order of the graph.
For example, a serializability order for Schedule
A would be
T5 T1 T3 T2 T4
Are there others?
Test for View Serializability
27
unlikely.
However practical algorithms that just check some sufficient
conditions for view serializability can still be used.
Recoverable Schedules
28
If T8 should abort, T9 would have read (and possibly shown to the user) an
inconsistent database state. Hence, database must ensure that schedules are
recoverable.
Cascading Rollbacks
29
Thank You