ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » Mainframe, CICS, TXSeries » SYNCPOINT - ROLLBACK

Post new topic  Reply to topic Goto page 1, 2  Next
 SYNCPOINT - ROLLBACK « View previous topic :: View next topic » 
Author Message
chandana06
PostPosted: Mon Apr 24, 2006 5:04 am    Post subject: SYNCPOINT - ROLLBACK Reply with quote

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
View user's profile Send private message
cschneid
PostPosted: Mon Apr 24, 2006 5:41 am    Post subject: Reply with quote

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
View user's profile Send private message
wschutz
PostPosted: Mon Apr 24, 2006 6:46 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
PeterPotkay
PostPosted: Mon Apr 24, 2006 1:05 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7717

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
View user's profile Send private message
wschutz
PostPosted: Mon Apr 24, 2006 3:57 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
chandana06
PostPosted: Mon Apr 24, 2006 7:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
chandana06
PostPosted: Tue Apr 25, 2006 6:34 am    Post subject: Reply with quote

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
View user's profile Send private message
wschutz
PostPosted: Tue Apr 25, 2006 6:41 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
chandana06
PostPosted: Tue Apr 25, 2006 9:13 am    Post subject: Reply with quote

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
View user's profile Send private message
wschutz
PostPosted: Tue Apr 25, 2006 10:06 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
chandana06
PostPosted: Tue Apr 25, 2006 5:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
wschutz
PostPosted: Tue Apr 25, 2006 5:53 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
chandana06
PostPosted: Tue Apr 25, 2006 7:47 pm    Post subject: Reply with quote

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
View user's profile Send private message
chandana06
PostPosted: Wed Apr 26, 2006 6:07 am    Post subject: Reply with quote

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
View user's profile Send private message
wschutz
PostPosted: Wed Apr 26, 2006 10:06 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » Mainframe, CICS, TXSeries » SYNCPOINT - ROLLBACK
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.