Author |
Message
|
chandana06 |
Posted: Mon Apr 24, 2006 5:04 am Post subject: SYNCPOINT - ROLLBACK |
|
|
Apprentice
Joined: 26 Jan 2006 Posts: 32
|
Hi All,
i have MQ & IMS online program. This program reads a record from the queue and updates the IMS database.
My requirement is that when ever there is a IMS abend i need to delete the corresponding record from queue.
I was planning to do a SYNCPOINT and then abend the program so that the queue record gets deleted and then abend caused rollback of the IMS database.
But this program is linking to another program which is doing certain DB2 updates. I need to roll back these DB2 updates also. I tried EXEC SQL ROLLBACK before SYNCPOIT in my program but it is not working.
Is there any other way to achieve this?
Regards,
Chandana _________________ Regards,
Chandana |
|
Back to top |
|
 |
cschneid |
Posted: Mon Apr 24, 2006 5:41 am Post subject: |
|
|
Novice
Joined: 22 Mar 2005 Posts: 13
|
I am not an IMS person, but I believe one generally does this by comparing MQMD-BACKOUTCOUNT to the queue's BOTHRESH property and moving the offending message to the queue designated by the original queue's BOQNAME property if BOTHRESH has been exceeded.
The category 4 SupportPac MA1K does this sort of logic for CICS, you may be able to adapt it for your purposes. |
|
Back to top |
|
 |
wschutz |
Posted: Mon Apr 24, 2006 6:46 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
You might want to look at my favorite zOS MQGET option: Mark Skip Backout:
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzal.doc/mkskbo.htm
In a nutshell:
Quote: |
...specify the MQGMO_MARK_SKIP_BACKOUT option on the MQGET call. This marks the MQGET request as not being involved in application-initiated backout; that is, it should not be backed out. Use of this option means that when a backout occurs, updates to other resources are backed out as required, but the marked message is treated as if it had been retrieved under a new unit of work.
|
_________________ -wayne |
|
Back to top |
|
 |
PeterPotkay |
Posted: Mon Apr 24, 2006 1:05 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Wayne, I never understood this option. Why not just get the mesage with NO_SYNCPOINT instead? _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
wschutz |
Posted: Mon Apr 24, 2006 3:57 pm Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Peter...NO_SYNC says that the message you got can't be part of a UOW. So you could loose it...
MQGET NO_SYNC
crash!
SQL insert to "normal business table" never happens, message gone.
The idea behind MSB is that after doing some processing, you decide the message is bad and you want to do "something else" with it.
MQGET MSB
SQL insert to "normal business table"
ooops... evil message discovered
ROLLBACK (message now in a new UOW)
SQL insert to "evil message table"
COMMIT  _________________ -wayne |
|
Back to top |
|
 |
chandana06 |
Posted: Mon Apr 24, 2006 7:12 pm Post subject: |
|
|
Apprentice
Joined: 26 Jan 2006 Posts: 32
|
Hi All,
I am using MQGMO-SYNCPOINT when i do am MQGET since, for most of the abend i need to retain the record in the queue. But for few untapped abends i need to use handle abend and remove the record (Using handle abend).
The reocrd would be in the buffer and i cannot do a MQGET with no_sync point.
Can i use EXEC CICS SYNCPOINT ROLLBACK?
Regard,
Chandana _________________ Regards,
Chandana |
|
Back to top |
|
 |
chandana06 |
Posted: Tue Apr 25, 2006 6:34 am Post subject: |
|
|
Apprentice
Joined: 26 Jan 2006 Posts: 32
|
Hi wschutz,
Thanks a lot for the post. I have tried this out.
I did an MQGET with MQGMO-MARK-SKIP-BACKOUT & MQGMO-SYNCPOINT When i encountered the abend i did an EXEC CICS SYNCPOINT ROLLBACK to revert the IMS updates.
but this record remained in the queue. could there be any reason for this.
I have even tried removing EXEC CICS SYNCPOINT ROLLBACK. the record is still in the queue.
thankQ
chandana _________________ Regards,
Chandana |
|
Back to top |
|
 |
wschutz |
Posted: Tue Apr 25, 2006 6:41 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
If you use a MSB, you need to do a COMMIT after the initial rollback. _________________ -wayne |
|
Back to top |
|
 |
chandana06 |
Posted: Tue Apr 25, 2006 9:13 am Post subject: |
|
|
Apprentice
Joined: 26 Jan 2006 Posts: 32
|
hi wschutz,
ThankQ for the reply.
should i be doing the following?
EXEC CICS SYNCPOINT
ROLLBACK *this would roll back the changes in IMS
END-EXEC
EXEC CICS SYNCPOINT
*this would remove the record from queue.
END-EXEC
But after the first comand i wld have the reord back in the queue and to my understanding SYNPOINT deletes the records in buffer. _________________ Regards,
Chandana |
|
Back to top |
|
 |
wschutz |
Posted: Tue Apr 25, 2006 10:06 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Quote: |
But after the first comand i wld have the reord back in the queue |
No, thats why you are specifying Mark Skip Backout. MSB "prevents" the message from rolling back into the queue after the FIRST backout.
Quote: |
and to my understanding SYNPOINT deletes the records in buffer.
|
That doesn't apply to YOUR buffer where you stored the MQ message. _________________ -wayne |
|
Back to top |
|
 |
chandana06 |
Posted: Tue Apr 25, 2006 5:38 pm Post subject: |
|
|
Apprentice
Joined: 26 Jan 2006 Posts: 32
|
Hi wschutz,
ThankQ for the post.
"If you use a MSB, you need to do a COMMIT after the initial rollback."
how to COMMIT (if not EXEC CICS SYNCPOINT).
Thanks a lot
regars,
Chandana _________________ Regards,
Chandana |
|
Back to top |
|
 |
wschutz |
Posted: Tue Apr 25, 2006 5:53 pm Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
I've tried to be general, since you started off talking about IMS. But if you are in a CICS region, then yes, you use EC SYNCPOINT to commit the message off the queue. _________________ -wayne |
|
Back to top |
|
 |
chandana06 |
Posted: Tue Apr 25, 2006 7:47 pm Post subject: |
|
|
Apprentice
Joined: 26 Jan 2006 Posts: 32
|
hi wschutz,
Thanks a lot fo the help.
i have tried
EXEC CICS SYNCPOINT
ROLLBACK
END-EXEC
EXEC CICS SYNCPOINT
END-EXEC
The record is still in the queue.
Following is the sequence of actions in my program.
MQopen with MQOO-FAIL-IF-QUIESCING & MQOO-INPUT-SHARED
MQGET with
MQGMO-SYNCPOINT
MQGMO-FAIL-IF-QUIESCING
MQGMO-WAIT
MQGMO-CONVERT
MQGMO-ACCEPT-TRUNCATED-MSG
MQGMO-MARK-SKIP-BACKOUT
Schedule PSB
If no abend terminate PSB
HANDLE ABEND
IF abend for which need to delete mq record and rollback IMS
EXEC CICS SYNCPOINT
ROLLBACK
END-EXEC
EXEC CICS SYNCPOINT
END-EXEC
end if
Is there anything i am missing
or any set up on the queue is required for this?
Regards,
Chandana _________________ Regards,
Chandana |
|
Back to top |
|
 |
chandana06 |
Posted: Wed Apr 26, 2006 6:07 am Post subject: |
|
|
Apprentice
Joined: 26 Jan 2006 Posts: 32
|
Hi wschutz,
The problem was i was abending after the second EC SYNCPOINT. And the record was in comming back to the queue.
But when i opened the queue with only SYNCPOINT option, even after EC SYNCPOINT if and abend happenned the record was not appearing in the queue.
but when i opened the queue with SYNCPOINT and MQGMO-MARK-SKIP-BACKOUT and after EC SYNCPOINT ROLLBACK and EC SYNCPOINT if i abend then record is appearing back in the queue.
Is this an expected behaviour?
ThankS Much !! _________________ Regards,
Chandana |
|
Back to top |
|
 |
wschutz |
Posted: Wed Apr 26, 2006 10:06 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Read step 8 in the flowchart on my previous link to the InfoCenter.... you must do another MQ operation (like an MQPUT) after the rollback but before the commit. Sorry I didn't mention that earlier (I'll be honest: I forgot about that detail ). _________________ -wayne |
|
Back to top |
|
 |
|