HW6: Transactions and Flights App Project

  1. Consider a database with 3 objects X, Y, and Z. Assume there are two transactions \(T_1\) and \(T_2\) that attempt the following operations:

    • \(T_1: R(X), R(Y), W(X)\)
    • \(T_2: R(X), R(Y), W(Y), R(X), R(Y)\), \(R(Z), W(X), W(Z)\)

    Recall that \(R(X)\) indicates reading \(X\) and \(W(Y)\) indicates writing \(Y\).

    Give an example schedule for \(T_1\) and \(T_2\) with the following properties:

    • The schedule is an interleaving of the operation of \(T_1\) and \(T_2\). In other words, it contains all the operations of \(T_1\) and \(T_2\) in the same order as given above.
    • It is not conflict serializable.

    For example, one schedule would be

    \(T_1\) \(T_2\)
    \(R_1(X)\)
    \(R_1(Y)\)
    \(W_1(X)\)
    \(R_2(X)\)
    \(R_2(Y)\)
    \(W_2(Y)\)
    \(R_2(X)\)
    \(R_2(Y)\)
    \(R_2(Z)\)
    \(W_2(X)\)
    \(W_2(Z)\)

    Notice how we use subscripts to denote which transaction the operation is from. This schedule executes all the operations of \(T_1\) first, followed by all the operations of \(T_2\). By definition, it is a serial schedule and therefore is conflict serializable. So it satisfies the first property required in this problem, but not the second property. You need to come up with a schedule for these transactions that is not conflict serializable.

    Justify why your answer is not conflict serializable.

  2. Consider the following schedule on three transactions. Is this schedule conflict serializable? Justify your answer.

    \(T_1\) \(T_2\) \(T_3\)
    \(R_1(A)\)
    \(W_1(A)\)
    \(R_3(A)\)
    \(W_3(A)\)
    \(R_2(A)\)
    \(R_1(B)\)
    \(R_3(B)\)
    \(R_1(B)\)
    \(W_3(B)\)
    \(R_2(B)\)
  3. Read the Flights App Project specification and complete the tasks described in Milestone 1. (Milestone 2 will be next week. Feel free to start on Milestone 2 once you are done with Milestone 1.)

Submit your work to gradescope as follows:

  • Submit your answers to problems 1 and 2, along with your ER-diagram to the "HW6 Written" assignment.
  • Submit the files described under "M1 Submission" in the project specification to the "Milestone 1" assignment.