- Induction asumption:
- Every schedule
Sn−1 of the
(read, write, lock and unlock) operations
found in n−1 transactions
T1,
T2, ...
Tn−1
(that obey the
locking semantics !!!) is
conflict-serializable
|
- Let Sn = a
schedule of the
(read, write, lock and unlock) operations
found in n transactions
T1,
T2, ...
Tn
(that obey the
locking semantics !!!)
- We must show that
Sn is
a conflict-serializable schedule
|
- Let
ui(•)
be the
first unlock operation
found in
schedule Sn:
Claim:
- We can move
all
the operations
ri(•) and wi(•)
of the
transaction Ti
forward in
schedule Sn
without passing
any
conflicting operation by
another transaction
Graphically:
|
In other words:
- Every operation
that preceeds an
operation X of
transaction Ti
do
not conflict
the
operation X
|
- Proof
of the claim:
- Consider an
aribitrary operation
by transaction Ti: e.g.,
wi(Y)
- Consider an
arbitrary
conflicting operation
of a transaction
Tj: e.g.,
wj(Y)
that
preceeds
wi(Y):
We will prove that
this ordering
of
operations is
not possible
I.e.:
- This ordering
will result in an
absurd result
(= contradictory result)
|
- In order for this ordering to be
legal
(= obeying
the 2-phase locking rules),
we must have
the following lock/unlock sequence on the
DB element Y:
- Since transaction Ti
is
2 Phased locking, the
first unlock operation
ui(•) must
follow
every
lock operations
In particular, the
first unlock operation
ui(X)
of transaction Ti
must
follow
ℓi(Y):
That means,
in
schedule Sn:
- The
transaction j performed
an
unlock operation
before
the first unlock operation
ui(•) in
the schedule Sn:
Conclussion:
- There is an
unlock operation
before the
first unlock operation
ui(•) !!!
|
|
This is a contradiction of
the fact that
ui(•)
is
first unlock operation
in the schedule Sn !!
|
So this claim is
true:
- Every operation
that preceeds an
operation X of
transaction Ti
do
not conflict
the
operation X
|
Therefore:
- We can move
all
the operations
ri(•) and wi(•)
by
transaction Ti
forward in
schedule Sn
without passing
any
conflicting operation by
other transactions:
|
- After moving
all operations of
transaction Ti forward,
we obtain the following
schedule S'n that
is conflict-equivalent to
the original schedule Sn:
Schedule S'n consists of:
- All operations by
transaction Ti
(= the first transaction that performs an
unlock operation)
is at the front
- Followed
by a (sub-)schedule
S''n−1
for
(n−1) (2-phased-locking)
transactions
|
By the
induction asumption that says:
- Every schedule
Sn−1
of n−1 transactions
T1,
T2, ...
Tn−1
that obey the
2-phased locking semantics is
conflict-serializable
|
We conclude that
the schedule S''n−1
(of (n−1) transactions)
is
conflict-serializable:
In other words:
Since
Sn is
conflict-equivalent to
S'n:
- The schedule Sn
is
conflict-serializable:
|
Q.E.D.
|