Database Reference
In-Depth Information
tions interacting with the database. How these operations of different transactions
are scheduled—in what sequence and at which intervals—has a direct bearing on
data integrity. Proper scheduling would result in preservation of integrity.
Let us review a few concepts about scheduling.
Schedule. Consists of a sequence of operations in a set of concurrent transactions
where the order of the operations of each transaction is preserved.
Serial schedule. Operations of different transactions are not interleaved. Leaves
database in a consistent state.
Nonserial schedule. Operations of different transactions are interleaved.
Complete schedule. A schedule that contains a COMMIT or ABORT for each
participating transaction.
Cascadeless schedule. A schedule is said to be cascadeless, that is, to be avoiding
cascading rollbacks, if every transaction in the schedule reads only data items
written by committed transactions.
Figure 15-12 explains the definitions using the operations of two transactions, T1
and T2. Note each example and understand the significance of the variations in the
schedule.
Now you will readily conclude that, given the operations of even four transac-
tions, you can arrange the operations in different ways and come up with many
T1
T2
T1
T2
READ (A)
A : = A + 100
WRITE (A)
READ (B)
B : = B + 200
WRITE (B)
BEGIN
READ (A)
A : = A + 100
WRITE (A)
READ (B)
B : = B + 200
WRITE (B)
COMMIT
END
T1
T2
READ (A)
A :
50
WRITE (A)
READ (B)
B :
=
A
-
BEGIN
READ (A)
A :
100
WRITE (B)
=
B
-
100
WRITE (A)
COMMIT
=
A
+
BEGIN
SCHEDULE
BEGIN
READ (A)
A : = A - 50
WRITE (A)
READ (B)
B :
END
READ (A)
A :
T1
T2
50
WRITE (A)
COMMIT
END
=
A
-
BEGIN
READ (A) BEGIN
A : = A + 100 READ (A)
WRITE (A) A := A - 50
READ (B) WRITE (A)
B : = B + 200 READ (B)
WRITE (B)
100
WRITE (B)
COMMIT
END
=
B
-
CASCADELESS
SCHEDULE
COMPLETE SERIAL
SCHEDULE
B :
=
B
-
100
COMMIT
ABORT
END
ROLLBACK
END
COMPLETE NON-
SERIAL SCHEDULE
Figure 15-12
Transactions and schedules.
Search WWH ::




Custom Search