View previous topic :: View next topic
|
Author |
Message |
raveeshk17
New User
Joined: 29 Jul 2010 Posts: 2 Location: Hyderabad
|
|
|
|
HI,
I am new working on MQ series.
I have a scenario where I am reading a MQ. AFter the message is successfully get from the MQ, and while processing the message and trying to insert it into DB2 tables, I got SOC4. When I see the message via MQmenu, I found that message deleted from the queue.
Is there any way I can roll back the MQGET call when I incur abend in the program?
Thanks in advance |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
are you using RRSAF?
If not, how are you scheduling your COMMITs with db2 and mqs? |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
This is fairly standard MQ processing.
Issue the MQGET with MQGMO-SYNCPOINT . If the application abends or issues a rollback, then the message is still available on the queue with the Backoutcount incremented. After a successful MQGET you should check the Backoutcount and, if => 1, then move the message elsewhere for action.
When an MQGET is issued, MQ just marks the message as 'unavailable' on the queue and doesn't remove it until the MQCMIT (or CICS SYNCPOINT &c.). In the event of a failure or rollback, the message is in simply marked 'available' and is in the exact same location as it had been previously.
A backoutcount > 1 suggests that this message has failed twice and is possibly the cause of the abend. As the message is likely now at the head of the queue, no further mesages will be processed until it has been removed (by issuing a commit).
Garry. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
also, what environment? Batch, CICS? |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
Processing is the same regardless of environment. Use environment's two-phase commit where available.
Garry. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
Processing is the same regardless of environment. Use environment's two-phase commit where available |
No, it is not.
in cics you handle things much differently than in batch;
syncpoints is a very big difference, since they don't like you issuing COMMITs in CICS.
and that is why I asked about RRSAF.
and obviously, you always attempt to use the two-phase commit......... |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
Dick,
The MQ process is the same. In CICS use an EXEC CICS SYNCPOINT which is that environment's two-phase commit (or EXEC CICS SYNCPPOINT ROLLBACK, if rolling back).
Garry. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
The TS is working with MQS and DB2. |
|
Back to top |
|
|
raveeshk17
New User
Joined: 29 Jul 2010 Posts: 2 Location: Hyderabad
|
|
|
|
Thanks a lot for the info.
It works now. |
|
Back to top |
|
|
|