An IT company developed a new database system to record the statics data of the coming Opera House Open Day including the number of reservations X, remaining gifts Y and meal combos ordered Z. Here is a schedule of three transactions:
S1, R1(X), S2, R2(Y), W1(X), E1, A, R2(X), S3, R3(X), B, W2(Y), E2, R3(Y), W3(X), W3(Z), E3
Si indicates the start point of transaction i;
Ei indicates the end point of transaction i;
Ri(X) indicates a read operation in transaction i on a variable X;
Wi(Y) indicates a write operation in transaction T i on a variable Y;
Regarding the following questions, give and justify your answers.
1) Assume that the system crashes at B, what should be done to recover the system?
2) Assume a checkpoint is made at point A, what should be done to the three transactions when the crash happens at B?
3) Is the transaction schedule serializable?
4) Construct a schedule (may not be the same as above) of these three transactions which causes deadlock when using two-phase locking protocol. If no such schedule exists, explain why.