# Type of Schedule

1. Recoverable Schedule

2. Irrecoverable Schedule

Once a transaction T is committed its should never be necessary to rollback T. The schedule that theoretically meet this criterion are called Recoverable.

A schedule S is recoverable if no transaction T in S commits until all transaction T' that have written some item X that T reads have committed.

Example :-

R1(X) R2(X) W1(X) R1(Y) W2(X) C2 W1(Y) C1

As can be seen from the example, T2 performs its last operation before T1's last operation. Also, T1 & T2 both operate on common items. Hence, for the schedule to be Recoverable, T2 should commit before T1 & the same happens here.

So, the given schedule is Recoverable.

A schedule where a committed transaction may have to be rolled back during recovery is said to be a non-recoverable or an irrecoverable schedule. and hence should not be permitted by DBMS.

Example :-

S : R1(X) W1(X) R2(X) R1(Y) W2(X) C2 A1

- A borting A1 would required ROLLBACK of all its operations.

- But T2's R2(X) and W2(X) were performed on the updated value of X by T1 i.e through W1(X).

- So, in order to make Database in consistent state, we would have to rollback these two operation (i.e. R2(X) and W2(X) ) of transaction T2.

2. Irrecoverable Schedule

**1. Recoverable Schedule :-**Once a transaction T is committed its should never be necessary to rollback T. The schedule that theoretically meet this criterion are called Recoverable.

A schedule S is recoverable if no transaction T in S commits until all transaction T' that have written some item X that T reads have committed.

Example :-

R1(X) R2(X) W1(X) R1(Y) W2(X) C2 W1(Y) C1

As can be seen from the example, T2 performs its last operation before T1's last operation. Also, T1 & T2 both operate on common items. Hence, for the schedule to be Recoverable, T2 should commit before T1 & the same happens here.

So, the given schedule is Recoverable.

**2. Irrecoverable Schedule :-**A schedule where a committed transaction may have to be rolled back during recovery is said to be a non-recoverable or an irrecoverable schedule. and hence should not be permitted by DBMS.

Example :-

S : R1(X) W1(X) R2(X) R1(Y) W2(X) C2 A1

- A borting A1 would required ROLLBACK of all its operations.

- But T2's R2(X) and W2(X) were performed on the updated value of X by T1 i.e through W1(X).

- So, in order to make Database in consistent state, we would have to rollback these two operation (i.e. R2(X) and W2(X) ) of transaction T2.

## No comments