Here is a sample schedule:
& R(Y) & \\ & W(Y) & \\ & Com. & \\ && R(Z) \\ && W(Z) \\ && Com. \end{bmatrix}</math>
In this example, Schedule D is the set of 3 transactions T1, T2, T3. The schedule describes the actions of the transactions as seen by the DBMS. T1 Reads and writes to object X, and then T2 Reads and writes to object Y, and finally T3 Reads and writes to object Z. This is an example of a serial schedule, because the actions of the 3 transactions are not interleaved.
Given E, the order of D has been changed, but in the end, E gives the same result as D.
& R(Y) & \\ && R(Z) \\
W(X) & & \\
& W(Y) & \\ && W(Z) \\Com. & Com. & Com. \end{bmatrix}</math>
& R(A) \\ & W(A) \\Com. & \\
& Com.\\ &\end{bmatrix}F2 = \begin{bmatrix} T1 & T2 \\ R(A) & \\ W(A) & \\
& R(A) \\ & W(A) \\Abort & \\ & Abort \\
&\end{bmatrix}</math>
These schedules are recoverable. F is recoverable because T1 commits before T2, that makes the value read by T2 correct. Then T2 can commit itself. In F2, if T1 aborted, T2 has to abort because the value of A it read is incorrect. In both cases, the database is left in a consistent state.
& R(A) \\ & W(A) \\ & Com. \\Abort & \\
&\end{bmatrix}</math>
In this example, G is unrecoverable, because T2 read the value of A written by T1, and committed. T1 later aborted, therefore the value read by T2 is wrong, but since T2 committed, this schedule is unrecoverable.
-- Example Here ---
In practice, most businesses aim for Conflict Serializable and Recoverable schedules.
Search Encyclopedia
|
Featured Article
|