Database Reference
In-Depth Information
6.3.1 Time-Shared DBMS Components
The synchronization process is represented by the same Fig.
6.2
, while the DBMS
components in Fig.
6.1
have some modified features, as follows:
The Bind compiler for
M
RC
is enriched with controls, to be inserted into com-
piled Application Plans, for embedded SQL statements—each CALL from a current
transaction has to verify if there are lock-constraints caused by other transactions:
if there is a blocking constraint then that application plan will not be executed but
x
2
will be only imposed to 1 and a RETURN will be executed (when
M
UC
receives
this error condition, it must wait, by repeating the same CALLs, until locks become
released by some other transaction (in some subsequent time-shared window)).
Each execution of some program
P(m)
on
M
UC
generates a number of trans-
actions in one of the following cases: when a program begins the execution and
for any execution of the statements COMMIT or ROLLBACK (in that case, the
precedent transaction
ID
T
is closed, a new transaction
ID
T
is open, and
Pr(ID
T
)
=
Pr(ID
T
)
=
P(m)
is imposed). At the beginning (initial state
st(
0
)
of
M
UC
)the
function
Pr
:
N
→
Ob
P
A
for the given schema
A
supported by RDB machine is
defined by
Pr(i)
is the empty program. We assume
that each transaction identifier (during concurrent execution of a number of pro-
grams) is a unique number for a universal machine
M
UC
: the first transaction has
ID
T
=
=
P
,i
=
1
,
2
,
3
,...
, where
P
∅
∅
1 with
Pr(
1
)
the first program to start the execution, and each next generated
transaction increments this value:
•
The main program of
M
UC
contains a Time-sharing Supervisor (in the basic
time-shared window) that decides which application program
∈
Pr(i)
K
,
P(m)
|
1
≤
i
≤
for
K
(which did not reach the stop state)
has to continue its execution in the next time-shared window (the next program
instruction) and is also responsible for a management of the transaction identi-
fiers and for a changing of the function
Pr
=
min
{
k
≥
1
|∀
j
≥
k, Pr(j)
=
P
∅
}
:
N
→
Ob
P
A
during run-time: when a
transaction
ID
T
of the program
P(m)
P
∅
is imposed (it is imposed also when this program ends its execution) and hence
there are no two different
ID
T
and
ID
T
=
Pr(ID
T
)
is finished then
Pr(ID
T
)
=
Pr(ID
T
)
.The
changing of the internal states of
M
UC
, caused by this time-sharing supervisor,
will not be considered (it is forgotten because it is not relevant) in the rest of this
chapter.
such that
Pr(ID
T
)
=
=
P
∅
•
The management of the time-shared windows is as follows: each time that a
new execution of some application program
P(m)
begins, the supervisor opens
a new window for such a program execution and sets
Pr(K)
=
P(m)
,
ID
T
=
K
with
K
; when a program in a some time-
shared window stops its execution (i.e., reaches a stop state of a program) this
window is closed. If there is no application program execution then only the
basic window for the main program of the Operation Multi-user system (mainly
for a Time-shared Supervisor) remains open. The stop state of the main program
corresponds to the turn-off for the universal machine
M
UC
.
=
min
{
k
≥
1
|∀
j
≥
k, Pr(j)
=
P
∅
}