Working with an Alerter
An alerter is used to asynchronously notify Publication Service of database changes. When an alerter is used, the adapter does not poll its publishing table for new rows at every interval. You can use an alerter when database changes are infrequent.
Procedures can be executed on the SQL command line or through any supported Application Programming Interfaces (APIs) (the procedures cannot be invoked successfully within a trigger). The procedures commit the inserts into the database table and notify the adapter of the commit.
Because an alerter runs with a database instance, not user schema, an adapter configuration cannot poll the publishing table name for just one user schema. For example, if the same publishing table exists in two user schemas and two adapter configurations are monitoring the same publishing table, each adapter configuration with a different user, both adapter configurations check the same publishing table whenever the alerter checks for changes in the publishing table.
- Alerter Process
To exchange information between sessions, an alerter on an Oracle database uses the Oracle AQ package while an alerter on a Microsoft SQL Server 2005 or higher database uses the Service Broker component. In this way, two or more sessions in the same database instance can synchronously communicate with each other. - Alerter Object Types and Stored Procedures
If you use an alerter as the polling method, object types and stored procedures are available for committing messages. The following table lists the available object types and stored procedures. - Starting an Alerter
To use the alerter polling method, you must install the Oracle AQ package or Microsoft SQL Server package on your specific database. See your Oracle documentation for information on how to install these components. - Example for Starting an Oracle Alerter
The following example shows how to execute the stored procedure on an Oracle database. In this example, a service of Publication Service with the TIBCO Rendezvous transport is configured with the alerter method selected. It is assumed that the rvpub.tra configuration has its data source name, user account name (demo) and password defined in the repository. - Example for Starting a Microsoft SQL Server Alerter
The following example shows how to execute the stored procedure on a Microsoft SQL Server database. A service of Publication Service with the TIBCO Rendezvous transport type is configured with the alerter method selected. It is assumed that the rvpub.tra configuration has its data source name, user account name (demo) and password defined in the repository.