Alerts and Pipe Messages

Alerts and pipe messages are sent and received using the DBMS_ALERT and DBMS_PIPE packages. They serve for the same purpose - communicating between different sessions, but they have following differences:

  • Alerts are sent only after the transaction, in which it was sent, is committed. If the transaction was rolled back alerts will not be sent. Pipe messages are asynchronous, they are sent independently of transactions.
  • Alert can be received by several sessions, that registered for this alert. Pipe message can be received only by one session.
  • Pipe messages with the same name do not overwrite each other, you can receive all pipe messages sent (if they were not received by someone else). Alerts with the same name overwrite each other. When you try to receive alert after several alerts have been sent, you will receive only the last sent alert.
  • You can start asynchronous listening by clicking the Start/Stop listening to alerts button to the alerts with specified name and all coming alerts with specified name will be displayed at the moment it was received. This feature is not available to the pipe messages. You can only use the Refresh button to get one pipe message.