Let and denote read and write operations respectively on a data item by a transaction . Consider the following two schedules.
Which one of the following options is correct?
View worked solution
Answer: B
To determine if the schedules are conflict serializable, we construct their precedence graphs. A schedule is conflict serializable if and only if its precedence graph contains no cycles.
Two operations conflict if they belong to different transactions, access the same data item, and at least one of them is a write operation.
1. Analysis of Schedule
Let's find the conflicting operations between transactions and :
- On item : occurs before . Since and conflict, this creates a directed edge:
- On item : occurs before . Since and conflict, this creates a directed edge:
The precedence graph for contains the cycle . Therefore, is not conflict serializable.
2. Analysis of Schedule
Let's find the conflicting operations between transactions and :
- On item : occurs before . This creates a directed edge:
- On item : occurs before . This creates a directed edge:
The precedence graph for has only one directed edge, , and contains no cycles. Therefore, is conflict serializable (equivalent to the serial execution order ).
Thus, is not conflict serializable, and is conflict serializable.
Free practice · Your answers on this page are not saved.
