Communicating from a Secondary to a Primary System

Processes executing in an SDS secondary system can communicate with processes executing in the primary, by using SDS event notifications.

When a process executing in a secondary system calls the Object::sdsCauseEvent method to cause a user event on a persistent object, the event is notified to subscribers on the primary system (assuming that it is connected) and not to subscribers on the secondary. Conversely, when a process executing in a secondary system calls the Object::sdeCauseEvent method to cause a user event on a persistent object, subscribers are notified of user events on the local system as well as on SDS secondary or primary systems, where applicable.

The sdsCauseEvent receiver object, also known as the event target, must be a persistent database object that is valid in the primary database at the time the event is caused. All user objects created in the primary database that have not been deleted are candidate event targets.

The sdeCauseEvent receiver object, also known as the event target, must be a persistent database object that is valid in the primary or secondary database at the time the event is caused. All user objects created in the primary or secondary database that have not been deleted are candidate event targets. It is also valid to use environmental objects such as system, global, and currentSchema that have the same identity in the primary and secondary database as event targets. On the other hand, it is best to avoid using environmental objects such as node and process, as these have independent identities and lifetimes between the primary and secondary databases.

To subscribe to events on a primary system caused within a secondary system, use the beginNotification, beginClassNotification, or beginClassesNotification method, identifying the target of the sdsCauseEvent and the required event type in the eventType parameter.

The userInfo parameter can be used to associate additional information with the event. This information is passed in the userInfo parameter of the sdeCauseEvent or sdsCauseEvent method to be received by event subscribers in the corresponding userInfo parameter of the userNotification or userNotify callback method.