Testing for Serializability: Serialization Graphs
Input: Schedule S for set of transactions T1, T2, …, Tk.
Output: Determination whether S is serializable.
Method:
- Create serialization graph G:
- Nodes: correspond to transactions
- Arcs: G has an arc from Ti to Tj if there is a Ti:UNLOCK(Am) operation followed by a Tj:LOCK(Am) operation in the schedule.
- Perform topological sorting of the graph.
- If graph has cycles, then S is not serializable.
- If graph has no cycles, then topological order is a serial order for transactions.
-
-
Theorem: This algorithm correctly determines if a schedule is serializable.