edited by
505 views
0 votes
0 votes

Suppose that the transaction T1 and T2 access the same database items.

$$\begin{array}{|l|l|} \hline T1 & T2 \\ \hline \text{read(X)} & {} \\ X=X-N & {} \\ \hline {} & \text{read(X)} \\ {} & X=X+N \\ \hline \text{write(X)} & {} \\ \hline {} & \text{write (X)} \\ \hline \end{array}$$

Which one of the following statements is correct about these two transactions?

  1. Dirty Read will occur
  2. Lost update will occur
  3. Both T1 and T2 are serial schedule
  4. This is an example of uncommitted data problem
edited by

2 Answers

Best answer
2 votes
2 votes
First T1 updates the value of X and then T2 overwrites the value of X written by T1. So the update made by T1 is lost. Hence, a lost update problem. Option B.
selected by
0 votes
0 votes

$X=X-N$

This is update, not write.

Write is specifically mentioned as write(X).

So, A is incorrect and B is correct.

Answer:

Related questions

1 votes
1 votes
1 answer
1
Bikram asked Nov 26, 2016
330 views
Consider the join of relation R with a relation S. If R has $m$ tuples and S has $n$ tuples, then the maximum and minimum sizes of the join, respectively, are __________....
0 votes
0 votes
1 answer
2
Bikram asked Nov 26, 2016
240 views
A functional dependency of the form x → y is trivial ify ⊆ xy ⊂ xx ⊆ yx ⊂ y
0 votes
0 votes
1 answer
3
Bikram asked Nov 26, 2016
313 views
What does the following Tuple Relational Calculus query produce?The expression σθ1 (E1 ⋈θ2 E2) is the same as: E1 ⋈θ1^ θ2 E2 (σθ1 E1) ∧ (σθ2 E2 ) E1 ⋈ θ...