Using event-hook procedures

This section describes some considerations for designing and using event-hook procedures.

Notes
  • Do not perform any COMMIT or ROLLBACK operations in event-hook procedures. The procedures are executed on the same connection as the synchronization, and a COMMIT or ROLLBACK may interfere with synchronization.
  • Don't change connection settings. Changing connection settings in a hook may produce unexpected results. If you need to change connection settings in a hook, the hook should restore the old value before the hook completes.
  • The event-hook connection calls the stored procedures without qualifying them by owner. The stored procedures must therefore be owned by either the user name employed on the dbmlsync connection (typically a user with REMOTE DBA authority), or a group ID of which the dbmlsync user is a member.
  • A remote database can only have one instance of each hook. Do not create multiple instances of a hook that have different owners.
  • Hook procedures must be created by a user with DBA authority.
  • If a *_begin hook executes successfully, the corresponding *_end hook is called regardless of any error that occurred after the *_begin hook. If the *_begin hook is not defined, but you have defined an *_end hook, then the *_end hook is called unless an error occurs prior to the point in time where the *_begin hook would normally be called.

#hook_dict table
Connections for event-hook procedures
Handling errors and warnings in event hook procedures