sdsCauseEvent(eventType: Integer; immediate: Boolean; userInfo: Any);
The sdsCauseEvent method of the Object class is used for inter-system event notification in a Synchronized Database Service (SDS).
The role-dependent usage scenarios are as follows.
From a primary system, to cause persistent events audited by the primary database for replay by secondary database servers. Calling this method on primary databases outside of transaction state raises an exception.
From a secondary system, to cause events that are notified to event subscribers on the primary system.
The behavior of the sdsCauseEvent method is database role-dependent. The three database role categories are listed in the following table.
Role | Action |
---|---|
Primary | When invoked within an SDS primary system, the sdsCauseEvent method audits the event for subsequent replay by SDS secondary databases. The event is not notified on the primary. The value of the immediate parameter must be false. |
Secondary | When invoked within an SDS secondary system connected to a primary database server, the sdsCauseEvent method triggers a corresponding event on the same receiver object in the primary system. The user event is not notified on the secondary system. Events caused on a secondary are assumed to be immediate, so the immediate parameter is therefore ignored. |
None | When invoked within a non-SDS-capable system, the method behavior is the same as the Object class causeEvent method. |
The parameters for the sdsCauseEvent method are listed in the following table.
Parameter | Description |
---|---|
eventType | Integer in the range User_Base_Event through User_Max_Event that represents the event being caused. |
immediate | You must set this parameter to false when the method is invoked from a primary system in a Synchronized Database Environment (SDE). An exception is raised if you call this method with the immediate parameter set to true on an SDS primary or a non-SDS database. |
userInfo | A value of any primitive type value (for example, a |
The following table lists the
Global Constant | Integer Value |
---|---|
User_Base_Event | 16 |
User_Max_Event | Max_Integer (#7FFFFFFF, equates to 2147483647) |
The actions of the sdsCauseEvent method are summarized in the following table, which lists the contexts in which the event is caused.
Database Role | Transient Target Object | Persistent Target Object, Immediate | Persistent Target Object, Deferred, in Transaction State | Persistent Target Object, Deferred, not in Transaction State |
---|---|---|---|---|
Undefined | Ignored | Exception | Local system | Exception |
Primary | Ignored | Exception | Secondary system | Exception |
Secondary | Ignored | Primary system | Immediately to primary system | Immediately to primary system |