7123019 Serializability by Amit Gupta

8
Data Base Management System Page 1 of 8 Amit Kr.Gupta B.E. 6 th (I.T.) BIT,Durg 1

Transcript of 7123019 Serializability by Amit Gupta

Page 1: 7123019 Serializability by Amit Gupta

Data Base Management System Page 1 of 8

Amit Kr.Gupta B.E. 6th (I.T.) BIT,Durg 1

Page 2: 7123019 Serializability by Amit Gupta

Data Base Management System Page 2 of 8

Amit Kr.Gupta B.E. 6th (I.T.) BIT,Durg 2

Page 3: 7123019 Serializability by Amit Gupta

Data Base Management System Page 3 of 8

Amit Kr.Gupta B.E. 6th (I.T.) BIT,Durg 3

Page 4: 7123019 Serializability by Amit Gupta

Data Base Management System Page 4 of 8

Amit Kr.Gupta B.E. 6th (I.T.) BIT,Durg 4

Page 5: 7123019 Serializability by Amit Gupta

Data Base Management System Page 5 of 8

Amit Kr.Gupta B.E. 6th (I.T.) BIT,Durg 5

Page 6: 7123019 Serializability by Amit Gupta

Data Base Management System Page 6 of 8

Amit Kr.Gupta B.E. 6th (I.T.) BIT,Durg 6

Page 7: 7123019 Serializability by Amit Gupta

Data Base Management System Page 7 of 8

Amit Kr.Gupta B.E. 6th (I.T.) BIT,Durg 7

Anomalies due to Interleaved Execution

There are three main ways in which a schedule involving two consistency

preserving, committed transactions could run against a consistent database and

leave it in an inconsistent state.

l Write – Read (WR) conflict

l Read – Write (RW) conflict

l Write – Write (WW) conflict

Ø Reading Uncommitted Data (WR Conflicts)

Here, a transaction T2 could read a database object A that has been modified by

another transaction T1, which has not yet committed.

Such a read is called Dirty Read.

Exammple: T1 T2

R(A)

W(A)

R(A)

W(A)

R(B)

W(B)

Commit

R(B)

W(B)

Commit

Ø Unrepeatable Reads (RW Conflicts)

Here, a transaction T2 could change the value of an object A that has been read by a

transaction T1, while T1 is still in progress.

If T1 tries to read the value of A again, it will get a different result,

even though it has not modified A in the meantime.

This situation could not arise in a serial execution of two transactions.

This type of read is called an Unrepeatable Read.

Ø Overwriting Uncommitted Data (WW Conflicts)

Here, a transaction T2 could overwrite the value of an object A, which has already

been modified by a transaction T1, while T1 is still in progress. Here, the problem is

that we have a lost update.

This type of write is called a blind write.

Page 8: 7123019 Serializability by Amit Gupta

Data Base Management System Page 8 of 8

Amit Kr.Gupta B.E. 6th (I.T.) BIT,Durg 8

View Serializability

Two schedules S1 and S2 over the same set of transactions, are view equivalent if

1. If Ti reads the initial value of object A in S1, it must also read the initial value of

A in S2.

2. If Ti reads a value of A written by Tj in S1, it must also read the value of A

written by Tj in S2.

3. For each data object A, the transaction that performs the final write on A in S1

must also perform the final write on A in S2.

* A schedule is view serializable if it is view equivalent to some serial

schedule.

* Every conflict serializable schedule is view serializable; but the converse is

not true.

* Any view serializable schedule that is not conflict variable contains a blind

write.

Recoverability:

If a transaction Ti fails, for whatever reason, we need to undo the effect of this

transaction to ensure the atomicity property of the transaction. In a system that

allows concurrent execution, it is necessary also to ensure that any transaction Tj

that is dependent on Ti (that is, Tj has read data written by Ti) is also aborted. To

achieve this surety, we need to place restrictions on the type of schedules permitted

in the system.

A recoverable schedule is one where, for each pair of transactions Ti and Tj such

that Tj reads a data item previously written by Ti, the commit operation of Ti

appears before the commit operation of Tj .