Skip to Content
Oracle PL/SQL Programming: A Developer's Workbook
book

Oracle PL/SQL Programming: A Developer's Workbook

by Steven Feuerstein, Andrew Odewahn
May 2000
Intermediate to advanced
594 pages
11h 32m
English
O'Reilly Media, Inc.
Content preview from Oracle PL/SQL Programming: A Developer's Workbook

Chapter 22. DBMS_PIPE Built-in Package

A pipe is a named communication channel that allows different database sessions to communicate. The basic logic of pipe-based applications is fairly straightforward (it’s illustrated in Figure 22-1):

  1. Program A creates a pipe and assigns it a name (it creates the data structure in the middle box in the figure).

  2. Program B packs, or loads, a message into a private buffer, which it then sends out over the pipe (left side of the figure).

  3. Program C, which is monitoring the pipe, sees the new message arrive and unpacks it into a private buffer; program C then processes the message it received from program B (right side of the figure).

Sending messages between sessions via DBMS_PIPE

Figure 22-1. Sending messages between sessions via DBMS_PIPE

The advantage of pipes is that they allow programs A, B, and C (as well as D, E, and F) to communicate independently across different sessions outside of their respective transactions. Without pipes (or the Advanced Queuing package, Oracle’s asynchronous messaging package), we might resort to message tables to achieve this sort of intersession communication. Program B would INSERT and then COMMIT—possibly interfering with the current transaction—a message into the table, and program C would SELECT the new message. The pipe eliminates the COMMIT and, since it resides in memory, is much faster than physically writing messages to (and reading messages from) a table. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Oracle Database 11g PL/SQL Programming Workbook

Oracle Database 11g PL/SQL Programming Workbook

Michael McLaughlin, John Harper

Publisher Resources

ISBN: 9781449324070Supplemental ContentErrata Page