Dbms II Ass1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Assignment

Database Management System II


Bsctc 20/09/05
A W A D T Nadeesha Abeysekara

Serial Schedules

• All the transactions execute serially one after the other.


• When one transaction executes, no other transaction is allowed to execute.

T1 T2
Read (A)
A:= A-50
Write(A)
Read(B)
B:=B+50
Write(B)
Read(A)
Temp:=A*0.1
A:A-temp
Write(A)
Read(B)
B:=B+temp
Write(B)

Non-serial Schedule o If interleaving of operations is allowed, then there


will be non-serial schedule.
o It contains many possible orders in which the
system can execute the individual operations of the transactions.
T1 T2
Read(A)
A=A-10
Read(A)
Temp=0.2*A
Write(A)
Read(B)

Write(A)
Read(B)
B=B+10
Write(B)
B=B+Temp
Write(B)

Serializability

Serial schedule both by definition and execution means that the


transactions bestowed upon it will take place serially, that is, one after the other.
This leaves no place for inconsistency within the database. But, when a set of
transactions are scheduled non-serially, they are interleaved leading to the
problem of concurrency within the database. Non-serial schedules do not wait for
one transaction to complete for the other one to begin. Serializability in DBMS
decides if an interleaved non-serial schedule is serializable or not.

1. Conflict Serializability

• Conflict serializability defines two instructions of two different transactions


accessing the same data item to perform a read/write operation.
• It deals with detecting the instructions that are conflicting in any way and
specifying the order in which the instructions should execute in case there is any
conflict.
• A conflict serializability arises when one of the instruction is a write operation.

View Serializability

• View serializability is the another type of serializability.


• It can be derived by creating another schedule out of an existing schedule and
involves the same set of transactions.
T1 T2 T3
Read(Q)
Write(Q)
Write(Q)
Write(Q)

You might also like