0% found this document useful (0 votes)
24 views3 pages

DB Transaction-2

Concurrency Control

Uploaded by

Srinibash Patra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views3 pages

DB Transaction-2

Concurrency Control

Uploaded by

Srinibash Patra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Schedule

A series of operation from one transaction to another transaction is known as schedule. It is used to
preserve the order of the operation in each of the individual transaction.

1. Serial Schedule
The serial schedule is a type of schedule where one transaction is executed completely before
starting another transaction. In the serial schedule, when the first transaction completes its cycle,
then the next transaction is executed.
For example: Suppose there are two transactions T1 and T2 which have some operations. If it has
no interleaving of operations, then there are the following two possible outcomes:
1. Execute all the operations of T1 which was followed by all the operations of T2.

2. Execute all the operations of T2 which was followed by all the operations of T1.

In the given (a) figure, Schedule A shows the serial schedule where T1 followed by T2. And in the
given (b) figure, Schedule B shows the serial schedule where T2 followed by T1.

2. Non-serial Schedule
If interleaving of operations is allowed, then there will be non-serial schedule. It contains many
possible orders in which the system can execute the individual operations of the transactions.
In the following figure (c) and (d), Schedule C and Schedule D are the non-serial schedules. It has
interleaving of operations.
3.Serializable schedule
The serializability of schedules is used to find non-serial schedules that allow the transaction to
execute concurrently without interfering with one another. It identifies which schedules are correct
when executions of the transaction have interleaving of their operations.
A non-serial schedule will be serializable if its result is equal to the result of its transactions executed
serially.

Serializability in DBMS
Serializability is a term that is a property of the system that describes how the different process
operates the shared data. If the result given by the system is similar to the operation performed by
the system, then in this situation, we call that system serializable. Here the cooperation of the system
means there is no overlapping in the execution of the data.
Serializability ensures that the final result is equivalent to the sequential operation of the data.
Serializability can be achieved through Serializable Schedule

Types of Serializability
1. Conflict Serializability
A database management system (DBMS) schedule’s ability to prevent the sequence of conflicting
transactions from having an impact on the transactions’ results is known as conflict serializability
in DBMS. Conflicting transactions are those that make unauthorized changes to the same
database data item.
Conflict serializability maintains the consistency of the database.
There is some condition for the conflict serializability of the database. These are as below.
o Both operations should have different transactions.
o Both transactions should have the same data item.
o There should be at least one write operation between the two operations.
Example
Transaction 1 Transaction 2 Transaction 3
R(x)
R(y)
R(x)
R(y)
R(z)
W(y)
W(z)
R(z)
W(x)
W(z)

2. View Serializability
View serializability is a type of operation in the serializable in which each transaction should produce
some result and these results are the output of proper sequential execution of the data item. Unlike
conflict serialized, the view serializability focuses on preventing inconsistency in the database.
View Serializability is the process of determining whether or not a given schedule is view serializable.
Example
Transaction 1 Transaction 2
R(a)
W(a)
R(a)
W(a)
R(b)
W(b)
R(b)
W(b)

Let’s swap the read-write operations in the middle of the two transactions to create the view
equivalent schedule.
Transaction 1 Transaction 2
R(a)
W(a)
R(b)
W(b)
R(a)
W(a)
R(b)
W(b)
What is a conflicting pair in transactions?
Two operations inside a schedule are called conflicting if they meet these three conditions:
1. They belong to two different transactions.
2. They are working on the same data piece.
3. One of them is performing the WRITE operation.
To conclude, let’s take two operations on data: "a". The conflicting pairs are:
1. READ(a) - WRITE(a)
2. WRITE(a) - WRITE(a)
3. WRITE(a) - READ(a)
Note:
There can never be a read-read conflict as there is no change in the data.

You might also like