Databases Reference
In-Depth Information
definition of composite events: Figure 3.5 shows a times event within the
interval delimited by a month since the approval of the course. A rules con-
dition is split into two kinds of predicates: predicates on the event parameters
(represented as a rhombus with a black angle) and predicates on the state of
the DB (depicted as a white rhombus). Finally, a rules action is denoted as a
rectangle where further black triangles are enclosed that stand for the policys
effect.
3.4.4
Active Behavior
Section 3.4.3 focused on the syntax of rules. Just as important is the run-time
behavior of sets of rules, which can be complex.
The run-time behavior of a collection of rules is determined by the exe-
cution model of the rule system supporting the rules. There are two principal
issues: (1) when rules are processed and (2) how multiple event occurrences
are handled.
3.4.4.1 When Rules Are Processed
When an event takes place that matches the definition of a rule, the rule is
triggered. It is possible that as soon as a rule is triggered, the transaction that
raised the event is suspended, and the rules condition and (if the condition is
true) the rules action are evaluated to completion right away.
However, that may not be the desired behavior. For example, consider
the following situation. Employee Tom has the salary 1000 and the boss
Sally. Employee Sally has the salary 1050. The following program is run:
update employee
set salary = salary * 1.10
What are the resulting salaries of Tom and Sally, given the rules defined in
Section 3.4.1? The answer is that it depends on the order in which the tuples
are updated in the employee table.
If Tom is processed before Sally, then the increase in Toms salary by
10% to 1100 will violate the integrity constraint and trigger the rule that
monitors updates to salaries. That in turn will cause Sallys salary to be
increased to 1100, thereby reinstating the constraint. However, after that
the update program will perform a further change to Sallys salary, making it
1100
1.10, or 1210. That probably was not the intention of the person who
wrote the update request.
*
Search WWH ::




Custom Search