|
Otros manuales para este modelo:
Resumen del manual
B Examples
To provide notification of changes to the database, SQL/MX integrates transactional
queuing and publish/subscribe into its database infrastructure. This appendix presents
typical scenarios that use transactional queuing and publish/subscribe services.
The examples presented in Section 2, Major Queuing Features and in Section 3,
Embedded SQL Examples use the tables specified in the scenarios later in this
appendix and in Appendix A, The Shipping Database.
Typical User Scenarios
The single underlying feature for the queuing and publish/subscribe services of
SQL/MX is the stream access mode, which allows applications to access regular
SQL/MX database tables as continuous data streams. Use of the stream access mode
is best explained by examples.
Scenario 1. The Quotes Channel is an example of a simple channel. The channel is a
regular database table that is used by applications to subscribe to newly published
quotes. The quotes are regular rows of data that are inserted into the channel. The
quotes remain in the table. All subscribers receive newly published quotes.
In this scenario, to subscribe to quotes in a channel, applications use a SELECT
statement specifying the stream access mode. New quotes are appended at the end of
the channel so that you can retrieve the quotes in the channel in the order of insertion.
Scenario 2. The Invoices Queue is an example of a queue. The queue is a regular
database table that is used by applications to dequeue newly published invoices. The
invoices are removed from the table. Consequently, only a single subscriber receives a
newly published invoice—that is, an invoice is processed only once.
In this scenario, to subscribe to and dequeue invoices in the queue, applications use a
SELECT statement that contains an embedded DELETE specification. The embedded
DELETE reads and removes invoices from the queue. When all available invoices
have been returned to the application, the embedded DELETE uses the stream access
mode to wait for new invoices to arrive.
Scenario 3. Invoice Processing by Priority is an example of a queue that is accessed
by applications using an ordered stream. The physical storage order of rows in a key-
sequenced table is determined by the clustering key.
An application can retrieve queue entries in the order of a user-defined clustering key
(specified either by the PRIMARY KEY clause or the CLUSTERING KEY clause) or a
system-generated clustering key, the SYSKEY, if there is no user-defined clustering
key. An application can also retrieve entries in the order of a column value if a
secondary index has been created for that column. In this scenario, the application
retrieves entries in the order of a column value for which an index has been created.
HP NonStop SQL/MX Queuing and Publish/Subscribe Services — 523734-002
B- 1
...Otros modelos de este manual:
Computadoras - HP Integrity NonStop J-Series (257.43 kb)
Computadoras - HP NonStop G-Series (257.43 kb)