Transactions
Transactions
TRANSACTIONS
Transaction
A transaction can be defined as a group of tasks that form a single
logical unit.
For example:
To withdraw Rs. 100 from an account.
Atomicity
Consistency
Isolation
Durability
Transaction States
Schedules
• Schedule is an order of multiple transactions executing in
concurrent environment.
Serial Schedule
Non Serial Schedule
Serializability
• When multiple transactions run concurrently, then it may lead to
inconsistency of data (i.e. change in the resultant value of data from
different transactions).
• Serializability is a concept that helps to identify which non serial
schedule and find the transaction equivalent to serial schedule.
Two types of Serializabilities
• Conflict serializability
• View serializability
Conflict Serializability
• Suppose T1 and T2 are two transactions and I1 and I2 are the
instructions in T1 and T2 respectively.
• Then these two transactions are said to be conflict
Serializable, if both the instruction access the data item d, and
at least one of the instruction is write operation.
Conflict - Three conditions
There should be different transactions
The operations must be performed on same data items
One of the operation must be the Write(W) operation
Step 2 :
1. Ti executes write(Q) before Tj executes read(Q), then draw edge from Ti to Tj.
Step 4 :
Now, if precedence graph is cyclic then it is a non conflict serializable schedule and if
the precedence graph is acyclic then it is conflict serializable schedule.
View Serializability
• If a given schedule is found to be view equivalent to some serial
schedule, then it is called as a view serializable schedule.
• Recoverable Schedule
• Cascadeless Schedule
Recoverable Schedule