Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 18

Types of Transaction

Serial Schedules
• Schedules in which the transactions are executed non-interleaved,
• i.e., a serial schedule is one in which no transaction starts until a
running transaction has ended are called serial schedules.
Complete Schedules

• Schedules in which the transactions are executed non-interleaved,


• i.e., a complete schedule is one in which last operation of Transaction is
either Commit or Abort.
Non Recoverable Schedule

• T2 read the value of A written by T1, and committed.


• T1 later aborted, therefore the value read by T2 is wrong, but
since T2 committed, this schedule is non-recoverable.
Recoverable Schedule
In Recoverable schedule, if a transaction is reading a value which has
been updated by some other transaction then this transaction can commit only
after the commit of other transaction which is updating value.

Recoverable Schedule example


Here Tb is performing read operation on X after the Ta has made
changes in X using W(X) so Tb can only commit after the commit operation of
Ta.
Cascading Schedule
• When there is a failure in one transaction and this leads to the rolling
back or aborting other dependent transactions, then such scheduling is
referred to as Cascading rollback or cascading abort.
Cascadeless Schedule:

• Also called Avoids cascading aborts/rollbacks (ACA).


• Schedules in which transactions read values only after all
transactions whose changes they are going to read commit are called
cascadeless schedules. Avoids that a single transaction abort leads to a
series of transaction rollbacks.
• A strategy to prevent cascading aborts is to disallow a transaction
from reading uncommitted changes from another transaction in the same
schedule.
• In other words, if some transaction Tj wants to read value updated or
written by some other transaction Ti, then the commit of Tj must read it after
the commit of Ti.
Cascadeless Schedule:
Cascadeless Schedule:
Strict Schedule:
• If in a schedule, a transaction is neither allowed to read nor write a
data item until the last transaction that has written it is committed or aborted,
then such a schedule is called as a Strict Schedule.
• In other words, Strict schedule allows only committed read and write
operations.
• Clearly, strict schedule implements more restrictions than
cascadeless schedule.
Strict Schedule:
• A schedule is strict if for any two transactions T i, Tj, if a write operation
of Ti precedes a conflicting operation of Tj (either read or write),
• then the commit or abort event of Ti also precedes that conflicting
operation of Tj.
• In other words, Tj can read or write updated or written value of Ti only
after Ti commits/aborts.
Remember
• Strict schedules are more strict than cascadeless schedules.
• All strict schedules are cascadeless schedules.
• All cascadeless schedules are not strict schedules.
Equivalent Schedule

T1 T2 T1 T2
R(A) R(A) R(A) = 100 R(A) = 100
A = A+10 A = A*1.1 A = 100+10 =110 A = 100*1.1 =110
W(A) W(A) W(A) = 110 W(A) = 110
Commit Commit Commit Commit
1. Result Equivalent Schedules
 
• If any two schedules generate the same result after their execution,
then they are called as result equivalent schedules.
• This equivalence relation is considered of least significance.
• This is because some schedules might produce same results for some
set of values and different results for some other set of values.
1. Result Equivalent Schedules
 
Are the following three schedules
result equivalent?

Let X = 2 and Y = 5.
On substituting these values, the results produced by each schedule are-
 
Results by Schedule S1- X = 21 and Y = 10
Results by Schedule S2- X = 21 and Y = 10
Results by Schedule S3- X = 11 and Y = 10
 
•Clearly, the results produced by schedules S1 and S2 are same.
•Thus, we conclude that S1 and S2 are result equivalent schedules.
2. Conflict Equivalent Schedules
 
• If any two schedules satisfy the following two conditions, then they
are called as conflict equivalent schedules-
• The set of transactions present in both the schedules is same.
• The order of pairs of conflicting operations of both the schedules is
same.
2. Conflict Equivalent Schedules
 

To check whether the given schedules are conflict equivalent or not,


•We will write their order of pairs of conflicting operations.
•Then, we will compare the order of both the schedules.
•If both the schedules are found to have the same order, then they will be conflict
equivalent.

You might also like