CTX_DBBase :: DBModify - Modify handler
The modify handler is called when a modification is signaled for the instance or property ( DBP_Modify event). This may happen before or after performing the modification. Usually, the DBP_Modify event is fired, when assigning another value to an attribute. The DBP_Modify event is not generated, when inserting or deleting an instance in a collection. The event is generated recursively for the structure containing the attribute. Moreover, modify events for structure instances are fired e.g. when copying instances.
Since modify events on the instance level are fired, whenever an attribute changes, it is usually not suggested to handle modify events in a structure context. This can be better done with the DBStore handler.
Within the DBModify () event handler, one may access old values by locating the old instance ( GetOldInstance ()). This allows comparing previous and new value.
When updating an instance directly without using property handle assignments, one should call the Modify() function to signal the modify events.
The handler can be overloaded in specialized context class implementations. When handling the modify event no values should be assigned to the instance of the property handle since this will cause another modification event and thus, a recursive call of the event handler. One may prevent recursion by setting a user state and checking it always when entering the modify event handler. The state should be reset at least in the stored handler to handle new modify events.