The deferred update algorithm presented before works
fine if only simple conversion functions have been defined
when evolving the schema. In case of complex conversion
functions, instead, the transformation of objects accessed
by complex conversion functions must be stopped before
reaching the state corresponding to the current history
entry to avoid database inconsistencies or run-time type
errors [7].
Suppose that a complex conversion function cf associated
to a history entry with t id = i of a class X transforms
objects of that class to conform to a history entry
with tid = j, where j > i. If other objects are accessed
by cf, their transformation should not be propagated up
to the current history entry, but it must be stopped at a
history entry which is the one visible by the conversion
function cf at the time it was defined. The concept of
visibility is modeled by the tid’s attached to each entry
in the history of a class.
The nth history entry of a class Y in the schema is
visible by cf if:
Y-desc ->history[n]->tid history[n-I]->tid > j
where history[nl indicates the nth history entry
descriptor in the history list of a class and
history Cn-II indicates the entry that chronologically
follows history [n] 3.
In order to stop the transformation of objects to the
visible history entry 02 maintains a stack associated to
each application. Before the execution of an application
or of a conversion function, the system pushes in the stack
the appropriate entry number signaling up to which entry
in the history an object has to be transformed (the actual
schema state for the application, or a smaller number for
a conversion function). This number is removed from the
stack after the execution of a conversion function or the
execution of an application.
The correctness of the deferred update algorithm has
formally been demonstrated in [6].
Reconsider the example in Section 2.2 where the complex
conversion function compute-sales accesses objects
of class Car to perform the computation of the vendor’s
turnover. Since the conversion function compute-sales is
supposed to transform objects of class Vendor to conform
to the history entry with tid = 34, the schema manager
of 02 pushes the value 3 on the stack. When an object
c of class Car is accessed by the conversion function, c
is transformed to conform to the history entry visible by
compute-sales, i.e. the one with tid = 2.