Multi-read Large Message Singleton Oracle Database Pipe- cache for shared context

Lucas Jellema
6 min readMay 13, 2024
Singleton Pipe to cache a 32KB message privately or publicly across database sessions

Database Pipes have been around in Oracle Database since release 7. In memory, light weight, non-persistent, fast and a little low level. Somewhat brittle: the contents of a pipe is lost when the database instances crashes. Pipes have been used to share information from within a running database session with the outside world — within or outside the database — without having to perform a commit. Debugging and logging and also transferring data to a shell program to process and possibly write to file. Messages in pipes could be no larger than 4KB until 12.1 and up to 8KB as of 12.2..

Database pipes used to work in a queue like fashion: FIFO and remove on read. Pipes could be read from in multiple sessions. However, each message could be read only once.

In Oracle Database 23ai there is now a new type of pipe. It is called “singleton pipe”. It takes a single message, that can be up to 32KB. The message can be read multiple times, by the same session and/or by different sessions.

Singleton Pipe to cache a 32KB message privately or publicly across database sessions

The message disappears from the pipe:

  • when its “shelflife” expires

--

--

Lucas Jellema

Lucas Jellema is CTO and IT architect at Conclusion, The Netherlands. He is Oracle ACE Director, one time JavaOne Rockstar and programmer