I'm studying transactions in the database, and I tried to do an exercise that relates to schedules 2PL.Is the schedule $S$ 2PL?$S: R1(x) R2(x) W1(x) W2(y) W1(y)$I know the definition of schedule 2PL and I know that there are different types.First I checked whether $S$ is serializable and it is not.Now how do I check if it is 2PL? There is a mechanical method?I tried to create a table like this:+-----------+------------------+-----+-----+| OPERATION |      LOCK        |  x  |  y  |+-----------+------------------+-----+-----+| R1(x)     | lock(T1, x) = OK | T1  |     |+-----------+------------------+-----+-----+| R2(x)     | lock(T2, x) = ?  |     |     |+-----------+------------------+-----+-----+| W1(x)     |                  |     |     |+-----------+------------------+-----+-----+| W2(y)     |                  |     |     |+-----------+------------------+-----+-----+| W1(y)     |                  |     |     |+-----------+------------------+-----+-----+But I am stuck. The transaction $T1$ has a lock on the object $x$, now $T2$ wants to read $x$. If the lock of $T1$ on $x$ is shared (S) then $T2$ can read $x$; if the lock is exclusive (X), $T2$ can not read $x$.I think it's more likely that the lock is shared, thus:+-----------+------------------+------+-----+| OPERATION |      LOCK        |  x   |  y  |+-----------+------------------+------+-----+| R1(x)     | lock(T1, x) = OK | T1S  |     |+-----------+------------------+------+-----+| R2(x)     | lock(T2, x) = OK | T2S  |     |+-----------+------------------+------+-----+| W1(x)     | lock(T1, x) = OK |      |     |+-----------+------------------+------+-----+| W2(y)     | lock(T2, y) = OK |      | T2X |+-----------+------------------+------+-----+| W1(y)     | lock(T1, y) = NO |      |     |+-----------+------------------+------+-----+Assuming I'm right, I tried to fill in the table but I'm not at all sure of what I did.Could someone help me?Thank you very much
Check if a schedule is 2PL
concurrency;database theory;databases