Explain the concept of recoverability in DBMS

DBMSDatabaseBig Data Analytics

The characteristics of non-serializable schedules are as follows −

  • The transactions may or may not be consistent.

  • The transactions may or may not be recoverable.

So, now let’s talk about recoverability schedules.

We all know that recoverable and irrecoverable are non-serializable techniques,

Irrecoverable schedules

If a transaction does a dirty read operation from an uncommitted transaction and commits before the transaction from where it has read the value, then such a schedule is called an irrecoverable schedule.

Example

Let us consider a two transaction schedules as shown below −

T1T2
Read(A)
Write(A)
-Read(A) ///Dirty Read
-Write(A)
-Commit
-
Rollback

The above schedule is a irrecoverable because of the reasons mentioned below −

  • The transaction T2 which is performing a dirty read operation on A.

  • The transaction T2 is also committed before the completion of transaction T2.

  • The transaction T1 fails later and there are rollbacks.

  • The transaction T2 reads an incorrect value.

  • Finally, the transaction T2 cannot recover because it is already committed.

Recoverable Schedules

If any transaction that performs a dirty read operation from an uncommitted transaction and also its committed operation becomes delayed till the uncommitted transaction is either committed or rollback such type of schedules is called as Recoverable Schedules.

Example

Let us consider two transaction schedules as given below −

T1T2
Read(A)
Write(A)
-Read(A) ///Dirty Read
-Write(A)
-
-
Commit

Commit // delayed

The above schedule is a recoverable schedule because of the reasons mentioned below −

  • The transaction T2 performs dirty read operation on A.

  • The commit operation of transaction T2 is delayed until transaction T1 commits or rollback.

  • Transaction commits later.

  • In the above schedule transaction T2 is now allowed to commit whereas T1 is not yet committed.

  • In this case transaction T1 is failed, and transaction T2 still has a chance to recover by rollback.

raja
Published on 08-Jul-2021 07:04:22
Advertisements