Oracle7 Server Application Developer's Guide
Checking for Alerts
Usually, Oracle is event-driven; that is, there are no polling loops. There are two cases where polling loops can occur:
- Shared mode. If your database is running in shared mode, a polling loop is required to check for alerts from another instance. The polling loop defaults to one second and can be set by the SET_DEFAULTS call.
- WAITANY call. If you use the WAITANY call, and a signalling session does a signal but does not commit within one second of the signal, then a polling loop is required so that this uncommitted alert does not camouflage other alerts. The polling loop begins at a one second interval and exponentially backs off to 30-second intervals.
SET_DEFAULTS Procedure
In case a polling loop is required, use the SET_DEFAULTS procedure to set the POLLING_INTERVAL. The POLLING_INTERVAL is the time, in seconds, to sleep between polls. The default interval is five seconds.
Syntax
The syntax for the SET_DEFAULTS procedure is
DBMS_ALERT.SET_DEFAULTS(polling_interval IN NUMBER);