in Databases
12,284 views
45 votes
45 votes

Which of the following scenarios may lead to an irrecoverable error in a database system?

  1. A transaction writes a data item after it is read by an uncommitted transaction
  2. A transaction reads a data item after it is read by an uncommitted transaction
  3. A transaction reads a data item after it is written by a committed transaction
  4. A transaction reads a data item after it is written by an uncommitted transaction
in Databases
12.3k views

3 Comments

APPROPIATE ANSWER IS D
0
0
  1. A transaction writes a data item after it is read by an uncommitted transaction 

 Blind Write. So commit or not, does not matter.

6
6
Thanks man :-)

You only made the point clear
0
0

5 Answers

45 votes
45 votes
Best answer
  1. Here if transaction writing data commits , then transaction which read the data might get phantom tuple/ Unrepeatable error. Though there is no irrecoverable error possible even in this option.
  2. This is non issue. Both transaction reading data.
  3. This is non issue.
  4. This is dirty read. In case if transaction reading uncommitted data commits, irrecoverable error occurs of uncommitted transaction fails. So (D) is answer
edited by

3 Comments

Can I please know as to why recovery from an unrepeatable read is possible in this scenario but a recovery from a dirty read is not?
1
1

@aiyyar.aarushi I think the reason is that since unrepeatable error is against the isolation property, database will undo the changes that was introduced , using the logs .In case of option (d) it is not that every dirty read leads to unrecoverable schedule, but it "may lead to an irrecoverable error" as the question has asked about "may lead to'' therefore option d is the right one since "if transaction reading uncommitted data commits, before the other transaction that did the write commits,  then irrecoverable error occurs if uncommitted transaction fails".

2
2

@aiyyar.aarushi in option D, if you abort the transaction which performed dirty read (after the other transaction has committed) no issue. If you abort the transaction which performed the write (after the other transaction has committed), you must rollback both transactions to ensure atomicity but if you abort the committed transaction, you would violate durability.

0
0
7 votes
7 votes
D. If Data is uncommitted , then transactions reads a data after write always give error.
4 votes
4 votes

 

I hope now it is clear which is the only case where IRRECOVERABILITY ARISES.

That is only when a particular transaction reads from a uncommited Transacation and , commits before the commit of the transaction whose data it was reading.

edited ago by
3 votes
3 votes
D

Option C is a normal operation. Option B is also fine as no write operation is involved. Option A can be recovered, but option D can't be.

1 comment

after write by uncommited transaction again write is a problem.

but after write by uncommited transaction then read why it will be problem?
–1
–1
Answer:

Related questions