Database Reference
In-Depth Information
or made permanent. These states
st
in
M
R
are distinguished by the fact that
t
2
(st
)
∗
(t
3
(st
)
+
1
)
=
1(i.e.,
x
3
=
1 and no errors,
x
2
=
0).
•
The ROLLBACK operation, by contrast, signals unsuccessful end-of-transaction:
it tells the transaction manager that something has gone wrong when the exe-
cution of COMMIT was previously attempted and
M
R
responded by an error
condition in the list
(
0
,n,
⊥
)
, with
n>
0, to
M
U
, the database might be in an
inconsistent state. In that case, after unsuccessful COMMIT operation, the host
program in
M
U
may send the call for ROLLBACK to
M
R
(i.e., calls the Ap-
plication Plan
P
2
) and all the updates made by the logical unit of work must be
“rolled back” or undone.
Executing either a COMMIT or a ROLLBACK operation establishes what is called
a synchronization point (abbreviated synchpoint), which represents the boundary
between two consecutive transactions. Thus, the consecutive transactions in
M
R
are defined by their states where
t
2
(st
(k))
(t
3
(st
(k))
1,
k>
0. The only
operations that establish a synchpoint are COMMIT, ROLLBACK and the machine
initiation. When a synchpoint is established then:
•
∗
+
1
)
=
All updates by the program since the previous synchpoint are committed (COM-
MIT) or undone (ROLLBACK).
•
All open cursors (in the host program
P
U
) are closed and all database positioning
is lost.
•
All record locks are released.
Transactions are indeed the unit of recovery and the unit of concurrency also. In
general, a single program execution will consist of a sequence of several transac-
tions, running one after another, with each COMMIT or ROLLBACK operation
terminating one transaction and starting the next. Now we are ready to give a formal
definition of an
atomic transaction
for a categorial RDB machine
M
R
.
Definition 42
A concept of an atomic transaction for a Categorial RDB machine
M
R
and for a source program
P
is represented in the category
R
P
=
R
M
(P )
(by Proposition
29
and Corollary
20
) as an arrow composed of all arrows
between the state
st
(k
−
∈
Obj
P
A
−
μy(t
2
(st
(k
−
−
y))
∗
(t
3
(st
(k
−
1
1
1
−
y))
+
1
)
−
1
=
0
))
and the state
st
(k)
,
k
1, such that
t
2
(st
(k))
(t
3
(st
(k))
≥
∗
+
1
)
=
1.
Remark
If schema
A
has a nonempty set
Σ
A
of integrity constraints then an atomic
DB
Sch
(G(
A
))
is not necessarily a transition between two
mod-
arrow in
Int(G(
A
))
⊆
els
of schema
(it is not guaranteed during the execution of each program
P
n
)
in
M
R
. Thus, only the strict subset of the arrows in
Int(G(
A
A
))
corresponds to the
consistent transitions in
M
R
.
Each atomic transaction is composed of a number of consecutive
RA
arrows
P
n
i
,1
k
, between the two consecutive synchpoints, not all of them must be
consistent: what is important is that the resulting composition
P
n
k
◦···◦
≤
i
≤
P
n
1
is
consistent.
The categorial semantics for a consistent database evolution-in-time can be given
by the following “consistent” natural transformation and its derived “transaction”
functors: