Constraint activation events

Previous Next

Constraints in USoft are activated when field-validation events, store-record events, and commit events occur.

To visualise when these events occur and how they are related, consider this picture. It depicts a transaction in which 2 records of a table A are manipulated as well as 1 record of a table B.

This picture clearly shows a 3-tier "box-in-a-box" structure. Fields are defined by field-validation boundaries and encased within records. Records are defined by store-record boundaries and encased within transactions. Transactions are defined by commit boundaries.

MR_clip0067

Each record has a number of fields (depicted horizontally next to each other, in this picture) that hold column values.

When a user interactively moves from field to field in a screen and enters values, a field-validation boundary is crossed each time she moves to the next field. This causes a field-validation event to occur. This event does not occur until the user does something that implies she has finished editing the field value.

When a SQL statement performs an INSERT, UPDATE or DELETE on behalf of a user, this involves supplying or updating one or more field values in one or more records. In the same way as during user interaction, for each of the field values affected, a field validation event occurs.

Each transaction has a number of records or rows (depicted vertically next to each other, in this picture) that are manipulated as part of the transaction:

When a user interactively moves from record to record in a screen and enters values, a record-validation boundary is crossed each time she moves to a different record. This causes a store-record event to occur. This event does not occur until the user does something that implies she has finished editing the record. It does not occur as long as she merely moves between fields within the same record.

When a SQL statement performs an INSERT, UPDATE or DELETE on behalf of a user, this involves supplying or updating one or more field values in one or more records. In the same way as during user interaction, for each of the records affected, a store-row event occurs.

As soon as a store-record event occurs, a transaction is opened. Other store-record events could follow, causing the transaction to span multiple records. In the example in the picture, the transaction has 3 records stored. Each transaction is concluded either by commit or rollback.

If the transaction is concluded by commit, a commit boundary is crossed separating this transaction from the next. This causes a commit event to occur.

If the transaction is concluded by rollback, the entire transaction is undone and has no further implications for constraint activation.

 

See also

Constraint evaluation order

Field-validation event

Store-record event

Commit event