Database Reference
In-Depth Information
T1
T2
T1
T2
T1
T2
BEGIN
READ (A)
A :
BEGIN
READ (A)
A :
BEGIN
READ (A)
A :
100
WRITE (A)
READ (B)
B : = B + 200
WRITE (B)
COMMIT
END
=
A
+
50
WRITE (A)
READ (B)
B : = B - 100
WRITE (B)
COMMIT
END
=
A
-
100
WRITE (A)
=
A
+
BEGIN
READ (A)
A :
50
WRITE (A)
A
=
-
BEGIN
READ (A)
A :
BEGIN
READ (A)
A : = A + 100
WRITE (A)
READ (B)
B : = B + 200
WRITE (B)
COMMIT
END
READ (B)
B : = B + 200
WRITE (B)
COMMIT
END
50
WRITE (A)
READ (B)
B :
=
A
-
100
WRITE (B)
COMMIT
END
B
=
-
READ (B)
B : = B - 100
WRITE (B)
COMMIT
END
SCHEDULE NOT
VIEW EQUIVALENT TO
SCHEDULE-1
SCHEDULE-1
SERIAL SCHEDULE
SCHEDULE-2
VIEW EQUIVALENT TO
SCHEDULE-1
Figure 15-16
View equivalent schedules.
For a particular data item, the transaction that performs the final write of that
data item in Schedule-1 must be the same transaction that performs the final
write of that data item in Schedule-2.
The above conditions ensure that each transaction reads the same values for the
particular data item in both schedules and that both schedules produce the same
final state of the database.
Figure 15-16 presents two schedules that are view equivalent.
View serializability
A schedule is view-serializable if it is view equivalent to a serial schedule.
In the next section, we will examine concurrency control options that establish
serializability of schedules. When serializable schedules execute, we derive both
benefits: (1) concurrent processing of transactions by interleaving operations and
(2) preservation of database integrity.
Recoverability
In our discussion on serializability, we considered schedules that are serializable and
therefore acceptable for preserving database consistency. The assumption had been
that no transaction failures occur during concurrent executions of transactions. You
know that this is not quite true. Concurrent transactions are as vulnerable to fail-
ures as serial executions. So we need to take into account the effect of transaction
failures during execution of concurrent transactions.
Search WWH ::




Custom Search