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.

Using HTTP to Access the AQ XML Servlet<br />

users has privileges to access the queue/topic specified in the request, the<br />

AQ servlet super-user creates a session on behalf of this db_user.<br />

For example, where the agent JOHN is mapped to the database user OE<br />

using the DBMS_AQADM.ENABLE_DB_ACCESS call, the servlet will create a<br />

session for the agent JOHN with the privileges of database user OE. (See<br />

"Mapping the AQ Agent to Database Users" for information on ENABLE_<br />

DB_ACCESS.)<br />

A new database transaction is started if no transaction is active in the HTTP<br />

<br />

session. Subsequent requests in the session will be part of the same<br />

transaction until an explicit COMMIT or ROLLBACK request is made.<br />

The requested operation<br />

<br />

(SEND/PUBLISH/RECEIVE/REGISTER/COMMIT/ROLLBACK) is<br />

performed.<br />

The response is formatted as an XML message and sent back the client.<br />

<br />

For example, the response for the preceding request may be as follows:<br />

<br />

<br />

<br />

<br />

0<br />

<br />

<br />

OE.OE_NEW_ORDERS_QUE<br />

12341234123412341234123412341234<br />

<br />

<br />

<br />

<br />

The response also includes the session id in the HTTP headers as a cookie.<br />

For example, Tomcat sends back session IDs as JSESSIONID=239454ds2343.<br />

If the operation does not commit the transaction, the transaction will<br />

remain active until an explicit commit/rollback call is received. The effects<br />

of the transaction are visible only after it is committed. If the transaction<br />

remains inactive for 120 seconds, it is automatically aborted.<br />

Internet Access to <strong>Advanced</strong> <strong>Queuing</strong> 17-61

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

Saved successfully!

Ooh no, something went wrong!