Tuesday, 25 February 2014

Cascading Rollback |Types of Cascading Rollback |Concurrency Control


CASCADING ROLLBACK

As shown in partial schedule each transaction observes two phase locking protocol. EG-


                    T5                 T6                 T7

                  Lock-X(A)                                                       
                  Read(A,a)
                  Lock-S(B)                                                       
                  Read(B,b)
                  Write(A,a)
                  Unlock(A)
                                        Lock-X(A)                                                       
                                        Read(A,a)
                                        Write(A,a)
                                        Unlock(A)
                                                               Lock-S(A)                                                       
                                                                Read(A,a)


                  Rollback



Let us consider if transaction T5 fails after the read(A,a) operation of transaction of T7. Then, T5 must be rolled back which also result into rolled back T6 & T7. Because transaction T6 & T7 reads the value modified by transaction T5. Thus,we can say that rollback of T5 results into rollback of T6 & T7 also. This problem is called a cascading of rollback.

SOLUTIONS TO AVOID CASCADING OF ROLLBACKS: -

1.) STRICT TWO PHASE LOCKING PROTOCOL:- It requires that in addition to locking being Two phase, all exclusive mode locks taken by a transaction must be held until that transaction commits.

2.) RIGOROUS TWO PHASE LOCKING PROTOCOL:- It requires all locks(Shared and Exclusive) to be held until the transaction commits.It can be easily verified that,this transaction can be serialized in the order in which they commit.                                                

0 comments:

Post a Comment