Rollback =
undoall
the updates performed
by a
transaction
Cascading rollback
Important fact:
If a
transaction T1writes
a DB element A
(and transaction T1
has not committed)
and
later the
transaction T2reads the
valuewritten by
transaction T1,
then:
The
validity of the
valueread by
transaction T2 will
depend
on
whether transaction T1
will commit
Cascading rollback:
Iftransaction T2
has read (used)dirty datawritten by
the
uncommitted transaction
T1:
then:
If the
transaction T1 is
aborted, then:
We must alsoaborttransaction T2 !!!
Graphically:
Cascading rollbackprocedure:
T = the transaction that has aborted
RollBack( T )
{
Undo the updates performed by transaction T;
// This depends on the logging method
// See below...
Let S = set of transactions that has read (dirty) data from T
for ( each Ti ∈ S ) do
{
Abort( Ti );
RollBack( Ti ); // This will abort and rollback
// ALL transactions that have read
// from T indirectly
}
}
How to rollback a transaction
Fact:
The rollback procedure
is different for
different logging methods !!!