recategorized by
73 views
1 votes
1 votes

Which of the following is/are correct? (Mark all the appropriate options)

  1. Every cascadeless schedule is a recoverable schedule.
  2. Every recoverable schedule is a cascadeless schedule.
  3. Every strict schedule is a cascadeless schedule.
  4. Every cascadeless schedule is a strict schedule.
recategorized by

2 Answers

3 votes
3 votes

In $\text{Recoverable schedule}$, if a transaction is reading a value which has been updated by some other transaction then this transaction can commit only after the commit of other transaction which is updating the value.

Here $T_{2}$ is performing read operation on $A$ after the $T_{1}$ has made changes in $A$ using $W(A)$ so $T_{2}$ can only commit after the commit operation of $T_{1}.$
$$\begin{array}{|c|c|c|} \hline T_{1} & T_{2} \\\hline R(A) \\ W(A) \\  & R(A) \\ & W(A) \\ & R(A) \\ \text{commit} \\ & \text{commit} \\\hline \end{array}$$
In a $\text{Strict schedule}$, if the write operation of a transaction precedes a conflicting operation (Read or Write operation) of another transaction then the commit or abort operation of such transaction should also precede the conflicting operation of other transaction.

Let's say we have two transactions $T_{1}$ and $T{2}.$ The write operation of transaction $T_{1}$ precedes the read or write operation of transaction $T_{2},$ so the commit or abort operation of transaction $T_{1}$ should also precede the read or write of $T_{2}.$

$$\begin{array}{|c|c|c|} \hline T_{1} & T_{2} \\\hline R(A) \\ & R(A) \\ W(A) \\ \text{commit} \\ & W(A) \\ & R(A) \\  & \text{commit} \\\hline \end{array}$$

Here the write operation $W(A)$ of $T_{1}$ precedes the conflicting operation (Read or Write operation) of $T_{2}$ so the conflicting operation of $T_{2}$ had to wait for the commit operation of $T_{1}.$

In $\text{Cascadeless Schedule}$, if a transaction is going to perform a read operation on a value, it has to wait until the transaction who is performing write on that value commits.

For example, let's say we have two transactions $T_{1}$ and $T_{2}.\; T_{2} $ is going to read the value $A$ after the $W(A)$ of $T_{1}$ then $T_{2}$ has to wait for the commit operation of transaction $T_{1}$ before it reads the $A.$

$$\begin{array}{|c|c|c|} \hline T_{1} & T_{2} \\\hline R(A) \\ W(A) \\ & W(A) \\ \text{commit}  \\ & R(A) \\ & W(A) \\ & \text{commit}\\\hline \end{array}$$

References:

So, the correct answer is $A;C.$

edited by
Answer:

Related questions

1 votes
1 votes
1 answer
2
gatecse asked Oct 15, 2020
96 views
If there are $n$ transactions each having $m_{1},m_{2},\dots,m_{n}$ operations respectively, the number of concurrent schedules possible is ______ (Mark all the appropria...