edited by
36,556 views
106 106 votes

Consider the following database schedule with two transactions $T_{1}$ and $T_{2}$.

$S= r_{2}\left(X\right); r_{1}\left(X\right); r_{2} \left(Y\right); w_{1} \left(X\right); r_{1} \left(Y\right); w_{2} \left(X\right); a_{1}; a_{2}$

Where $r_{i} (Z)$ denotes a read operation by transaction $T_{i}$ on a variable $Z$, $w_{i}(Z)$ denotes a write operation by $T_{i}$ on a variable $Z$ and $a_{i}$ denotes an abort by transaction $T_{i}$.

Which one of the following statements about the above schedule is TRUE?

  1. $S$ is non-recoverable.
  2. $S$ is recoverable, but has a cascading abort.
  3. $S$ does not have a cascading abort.
  4. $S$ is strict.

12 Answers

Best answer
109 109 votes

Answer is C

$${\begin{array}{|c|c|}\hline
\textbf{T1}&    \textbf{T2} \\\hline  & \text{R(x)} \\
     \text{R(x)} \\   &      \text{R(y)} \\    
\text{W(x)}&     \\ \text{R(y)} \\ & \text{W(x)} \\ \text{a1} \\ &      \text{a2} \\     \hline
\end{array}}$$

(A): This is not possible, because we have no dirty read ! No dirty read $\implies$ Recoverable

(B): This is not possible, because of no Dirty read ! No dirty read $\implies$ No cascading aborts !

(D): This is not true, because we can see clearly in image that after W1(X) before T1 commit or aborts T2 does W2(x) !

C is only option remaining !

edited by
7 7 votes
option (c). No cascading rollback. Because no dirty read.
7 7 votes

A) False because at a1 it aborts and a2 is still to be executed, therefore it's recoverable!  It would only be non recoverable if the abort happens after either T1 or  T2 commits. 

B) To check for cascading aborts - First check if it's Cascadeless b/c Any Schedule which is NOT cascadeless is cascading aborts.

Now, Necessary condition for Cascadeless is - Producer - Consumer  ie (W-R) conflict but there's no PC (W-R conflict) in here. Therefore it's Cascadeless and a Cascadeless schedule can never be Cascading aborts!

Note: Every cascadeless schedule is recoverable always! Foolproof option A)

C) True as reason as B) 

D) False as before T2 commits, T1 is reading as well as writing! 

edited by
1 1 vote
option c is correct the above schedule does not have cascading aborts.

Cascading aborts occurs only when there is a write by $T_i$ on data item x followed by read operation on  the same data item by $T_j$

but here $T_1$ performs $w_1$(x) which is no where followed by $r_2$(x).

See carefully  $w_1$(x) is followed by  $w_2$(x). write operation by two transactions on same data item is allowed in cascadeless schedules.

Hence the above schedule is cascadeless.
0 0 votes
I think the answer is B )

because the transaction is recoverable and it's cascading oborts because if T1 transaction faliure causes T2 transaction to Roll it back
1 flag:
✌ Edit necessary (Raizel)
Answer:
Position:
Show:

Related questions

54 54 votes
8 answers 8 answers
25.5k
25.5k views
Akash Kanase asked Feb 12, 2016
25,521 views
Suppose a database schedule $S$ involves transactions $T_1,\ldots,T_n$ . Construct the precedence graph of $S$ with vertices representing the transactions and edges repr...
81 81 votes
3 answers 3 answers
18.4k
18.4k views
Akash Kanase asked Feb 12, 2016
18,381 views
Consider the following database table named water_schemes:$$\overset{\text{Water_schemes}}{\begin{array}{|c|c|c|}\hline\textbf{scheme_no}& \textbf{district_name}& \te...
62 62 votes
5 answers 5 answers
19.6k
19.6k views
Akash Kanase asked Feb 12, 2016
19,555 views
B+ Trees are considered BALANCED because.The lengths of the paths from the root to all leaf nodes are all equal.The lengths of the paths from the root to all leaf nodes d...
99 99 votes
11 answers 11 answers
36.6k
36.6k views
Sandeep Singh asked Feb 12, 2016
36,611 views
Consider the following two phase locking protocol. Suppose a transaction $T$ accesses (for read or write operations), a certain set of objects $\{O_1,\ldots,O_k \}$. This...