Database Reference
In-Depth Information
Proof
In fact, for any arrow
P
◦
_
:
P
1
→
P
2
in
P
with
P
2
=
P
◦
P
1
, the following
A
diagram of functors in
Cat
commutes:
The vertical arrows in the commutative diagram in
Cat
above are the “forgetful”
functors, whose example is represented in Fig.
6.4
, while the horizontal arrows are
the inclusion functors (the category
U
P
1
is a subcategory of the category
U
P
2
, and
R
P
1
is a subcategory of the category
U
R
2
).
Remark
Each atomic arrow
P
n
,
n
R
M
(P )
obtained for a
given source program
P
, which is an arrow in
RA
as well, can be considered as a
program composed of a set of instruction of
M
R
(see the table of Program 2).
Consequently, we have the following equations for the sequential composition
with the 'identity program'
P
NOP
:
≥
3 in a category
R
P
=
(
IDC
)P
NOP
◦
P
n
=
P
n
◦
P
NOP
=
P
n
,
for
n
≥
3
.
6.2.2 The Categorial Approach to the Transaction Recovery
The problems of recovery and concurrency in a database system are heavily bound
up with the notion of transaction processing. In this section therefore, we first ex-
plain what a transaction is, what the term transaction processing (or transaction
management) from a categorial point of view means, and how a database conserves
the integrity constraints during execution of the application programs.
We can define a
transaction
as a logical unit of work. During an execution of pro-
grams, the database is not even consistent between two updates; thus a logical unit
of work (i.e., transaction) is not necessarily just a single database operation; rather,
it is a
sequence
of several such operations (each operation in our working frame-
work is an arrow
P
n
of
RA
), which in general transforms a consistent state of the
database (data memory of a categorial RDB machine
M
R
) into another consistent
state, without necessarily preserving consistency at all intermediate states.
We define the graph
G(
A
)
for a schema
A
(by Proposition
15
in Sect.
4.1.1
) and
its sketch category
Sch
(G(
A
))
. Let the current instance-database in the dynamic
data memory of
M
R
be
α
∗
(
, and after the execution
of a given Application plan
P
n
(derived by compilation of the source program
P
),
whichisanarrowin
RA
, we obtain the new instance-database
A
1
=
A
)
={
α(r
i
)
|
r
i
∈
S
A
}∪{⊥}
α
1
(
A
)
in the