Does anybody know of a place to get hold of a decent example to allow MQ to coordinate units of work with external resource managers - for instance Oracle.
I am writing a java application for MQ that will get a message from a queue, insert the contents of the queue into an external Oracle Database and then close the transaction. However it is not very clear from the documentation what constitutes a unit of work in a global transaction and I have been unsuccessful with getting MQ to do the commit and rollback successfully. Further more I get the error code 2372 MQ_PARTICIPANT_NOT_DEFINED which is not documented anywhere ( also noticed this in a separate topic. Here is the logic I use in my program ( with equiv MQ API calls in brackets).
1. Connect to an MQ queue manager - (MQCONN)
2. Start Transaction - (MQBEGIN)
3. Open queue - (MQOPEN)
4. Obtain connection to OracleXA (USE JDBC)
5. Get message and process (MGET)
6. Build Prepared statement and execute (SQL)
7. Call commit or rollback (MQCMIT/MQBACK)
8. Disconnect from the queue
I use 2 separate JDBC connections in point 4 and point 6.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum