SQL/MX Queuing and Publish/Subscribe Services
Major Queuing Features
HP NonStop SQL/MX Queuing and Publish/Subscribe Services—523734-002
2-7
Skip Conflict Access
Skip Conflict Access
The skip conflict access method is important in implementing an efficient transactional
queuing feature. It prevents concurrent transactions from blocking each other by
waiting for the release of locks on rows currently being inserted or updated while other
rows are available that are not currently locked by another transaction.
Transactional queuing implies that entries are read and deleted with a single operation
as part of a transaction. Entries are removed from the queue after the associated
transaction commits. Newly inserted or updated entries become available after the
associated transaction commits. If necessary, you can execute several operations as
part of the same transaction—for example, dequeueing a request and completing the
work of that request as part of the same transaction.
To prevent concurrent transactions—for example, multiple applications dequeueing
requests—from interfering with each other, applications use skip conflict access.
From Scenario 2. The Invoices Queue (page B-5), this SELECT statement uses the
skip conflict access mode:
SELECT * FROM
(DELETE FROM STREAM(invoices)
FOR SKIP CONFLICT ACCESS) AS invoices;
CONTRACTNBR AMOUNT PRIORITY ARCHIVE
----------- ----------- ----------- -------
100 10500 1 Y
200 20390 2 Y
300 30800 3 Y
Another application issues the same SELECT statement:
SELECT * FROM
(DELETE FROM STREAM(invoices)
FOR SKIP CONFLICT ACCESS) AS invoices;
This second application cannot access the rows locked by the first application.
However, the skip conflict access prevents the second application from timing out as a
result of waiting for rows locked by the first application. If the second statement were
not using SKIP CONFLICT ACCESS, the second application would be waiting on the
lock held on the first row by the first application, and the first application would be
waiting for more rows.