Content deleted Content added
→Types of schedule: explained the purpose of undoing all the actions |
→Unrecoverable: Improved explanation and made headings better organized. |
||
Line 378:
===Recoverable===<!-- This section is linked from [[Concurrency control]] -->
In a '''recoverable schedule''', transactions only commit after all transactions whose changes they read have committed. A schedule becomes '''unrecoverable''' if a transaction <math>T_i</math> reads and relies on changes from another transaction <math>T_j</math>, and then <math>T_i</math> commits and <math>T_j</math> aborts.
{| class="wikitable"
!F: T1
!F: T2
!F2: T1
!F2: T2
!G: T1▼
!G: T2▼
|-
|R(A)▼
|▼
|R(A)
|
Line 391 ⟶ 394:
|
|-
|W(A)▼
|▼
|W(A)
|
Line 396 ⟶ 401:
|
|-
|▼
|R(A)▼
|
|R(A)
Line 401 ⟶ 408:
|R(A)
|-
|▼
|W(A)▼
|
|W(A)
Line 410 ⟶ 419:
|Abort
|
|
|Com.
▲|
|Abort▼
|}These schedules are recoverable. The schedule F is recoverable because T1 commits before T2, that makes the value read by T2 correct. Then T2 can commit itself. In the F2 schedule, if T1 aborted, T2 has to abort because the value of A it read is incorrect. In both cases, the database is left in a consistent state.▼
▲!T1
▲!T2
|-
▲|R(A)
|
|Com.▼
▲|W(A)
|
▲|
▲|R(A)
▲|
▲|W(A)
▲|
▲|Com.
|Abort
▲|Abort
|
|}
▲
====Cascadeless====
|