Processing Queues
SSOLite stored procedures write messages to the BG processes using the default background message queues, using a round-robin allocation on a per-session basis. This means that every time a new database session is started the first defined queue (BGMBOX1) is used first. As a result, BGMBOX1 can become overloaded if database sessions are not persisted.
You can override this default behavior for specific transactions by using the SW_SET_QUEUE and SW_UNSET_QUEUE control procedures.
Alternatively, you can dedicate specific message queues to handling requests from your SSOLite stored procedure calls. To do this:
| 1. | Create a new Mbox set named SSOLITE. (The Mbox set can use either existing message queues or new ones.) |
| 2. | Set the MBSET_WRITE_BG process attribute for your application to assign the SSOLITE1 queue to it. All messages posted to a BG process by the SSOLite stored procedures will now use the SSOLITE Mbox set. |
The following example shows a series of commands that you could use to do this.
# Add a new SSOLITEQ1 message queue. (Remember to create the
# table ssolitemboxtable and the ssolitemboxqueue AQ first.)
#
swadm add_queue SSOLITEQ1 Local 0001::ssolitemboxtable:ssolitemboxqueue
# Add a new SSOLITE Mbox set.
#
swadm add_mboxset SSOLITE Local
# Add the SSOLITEQ1 message queue to the SSOLITE Mbox set (6 is the
# Mboxset ID of the SSOLITE Mbox set).
#
swadm add_queue_to_mboxset 6 7
# Set MBSET_WRITE_BG so that calls from the application’s SSOLITE
#stored procedures use the SSOLITE Mbox set to write messages to the
#BG processes.
#
swadm set_attribute1 SSOLITE 0 MBSET_WRITE_BG 6
#
#Set background processes to read from the queue
#
swadm add_process 1 BG Y
swadm set_attribute 1 BG 5 MBSET_READ_BG 6
|
Note |
The SSOLite stored procedures cache queue information. Therefore, you must shut down and restart all database connections if you change your message queue configuration in this way. |
For more information about message queue configuration, see:
| • | Mbox Sets and Message Queues. |
| • | "Administering Message Queues and Mbox Sets" in TIBCO iProcess Engine Administrator's Guide. |