09.12.2012 Views

Advanced Queuing - Oracle

Advanced Queuing - Oracle

Advanced Queuing - Oracle

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

General Features of <strong>Advanced</strong> <strong>Queuing</strong><br />

Queue-Level Access Control<br />

To propagate to a remote destination queue, the login user specified in the database<br />

link in the address field of the agent structure should either be granted the<br />

ENQUEUE ANY QUEUE privilege, or be granted the rights to enqueue to the<br />

destination queue. If the login user in the database link also owns the queue tables<br />

at the destination, no explicit privilege grant is needed.<br />

Visual Basic (OO4O): Example Code<br />

Use the dbexecutesql interface from the database for this functionality.<br />

Java (JDBC): Example Code<br />

No example is provided with this release.<br />

<strong>Oracle</strong> supports queue-level access control for enqueue and dequeue operations.<br />

This feature allows the application designer to protect queues created in one schema<br />

from applications running in other schemas. The application designer needs to<br />

grant only minimal access privileges to the applications that run outside the queue<br />

schema. The supported access privileges on a queue are ENQUEUE, DEQUEUE and<br />

ALL. For more information, see "<strong>Oracle</strong> Enterprise Manager Support" on page 4-8.<br />

Scenario<br />

The BooksOnLine application processes customer billings in its CB and CBADM<br />

schemas. CB (Customer Billing) schema hosts the customer billing application, and<br />

the CBADM schema hosts all related billing data stored as queue tables.<br />

To protect the billing data, the billing application and the billing data reside in<br />

different schemas. The billing application is allowed only to dequeue messages<br />

from CBADM_shippedorders_que, the shipped order queue. It processes the<br />

messages, and then enqueues new messages into CBADM_billedorders_que, the<br />

billed order queue.<br />

To protect the queues from other illegal operations from the application, the<br />

following two grant calls are needed:<br />

PL/SQL (DBMS_AQADM Package): Example Code<br />

/* Grant dequeue privilege on the shopped orders queue to the Customer<br />

Billing application. The CB application retrieves orders that are shipped but<br />

not billed from the shipped orders queue. */<br />

EXECUTE dbms_aqadm.grant_queue_privilege(<br />

'DEQUEUE','CBADM_shippedorders_que', 'CB', FALSE);<br />

8-4 <strong>Oracle</strong>9i Application Developer’s Guide - <strong>Advanced</strong> <strong>Queuing</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!