# DBMS Unit 4 Part 2 Transaction Processing Concept

Que4.11. What’s priority graph? How can it be used to test the conflict serializability of a schedule? Answer Priority graph 1. A priority graph is a directed graph G = ( N, E) that consists of set of bumps N = { T1, T2,., Tn} and set of directed edges E = ( e1,e2., em). 2. There’s one knot in the graph for each sale Ti in the schedule. 3. Each edge ei in the graph is of the form( Tj Tk), 1 j n, 1 k n, where Tj is the starting knot of ei and Tk is the ending knot of ei. 4. Such an edge is created if one of the operations in Tj appears in the schedule before some disagreeing operation in Tk. Algorithm for testing conflict serializability of schedule S a. For each sale Ti sharing in schedule S, produce a knot labeled Ti in the priority graph. b. For each case in S where Tj executes aread_item( X) after Ti executes awrite_item( X), produce an edge( Ti Tj) in the priority graph. c. For each case in S where Tj executes awrite_item( X) after Ti executesread_item( X), produce an edge( Ti Tj) in the priority graph. d. For each case in S where Tj executes awrite_item( X) after Ti executes awrite_item( X), produce an edge( Ti Tj) in the priority graph. e. The schedule S is serializable if and only if the priority graph has no cycles. 5. The priority graph is constructed as described in given algorithm. 6. still, schedule S isn’t( conflict) If there’s a cycle in the priority graph. serializable; if there’s no cycle, S is serializable. 7. In the priority graph, and edge from Ti to Tj means that sale Ti must come ahead sale Tj in any periodical schedule that is original to S, because two disagreeing operations appear in the schedule in that order. 8. still, we can produce an original If there’s no cycle in the priority graph. periodical schedule S that’s original to S, by ordering the deals that share in S as follows Whenever an edge exists in the priority graph from Ti to Tj, Ti must appear before Tj in the original periodical schedule S. Que4.13. bandy cascadeless schedule and slinging rollback. Why is cascadeless of schedule desirable? Answer Cascadeless schedule Refer

Q.4.10, runner 4 – 9A, Unit- 4. Cascading rollback Slinging rollback is a miracle in which a single failure leads to a series of sale rollback. For illustration Schedule S In the illustration, sale T1 writes a value of A that’s read by sale T2. sale T2 writes a value of A that’s read by sale T3. Suppose that at this point T1 fails. T1 must be rolled back. Since T2 is dependent on T1, T2 must be rolled back, since T3 is dependent on T2, T3 must be rolled back. Need for cascadeless schedules Cascadeless schedules are desirable because the failure of a sale does not lead to the aborting of any other sale. This comes at the cost of lower concurrency.