Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

MQ Transaction records gets lost if the task abends!

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Java & MQSeries
View previous topic :: :: View next topic  
Author Message
Govardhana krishna

New User


Joined: 29 Apr 2008
Posts: 9
Location: INDIA

PostPosted: Wed Sep 28, 2011 10:29 am    Post subject: MQ Transaction records gets lost if the task abends!
Reply with quote

Hi,
The program opens & gets a MQ record and while processing in the program if abnormal termination is encountered, the MQ record is not restored instead it is destroyed.

Note:
I use EXEC CICS SYNCPOINT ROLLBACK END-EXEC, but still unable to restore. Also i did compare the MQ OPEN/GET commands with other programs which does restore properly during abnormal termination!.

I have shown below with the exact syntax used to open , get a MQ record:
Please suggest me what could be the problem.


Code:
MQOPEN:
 COMPUTE WS-OPTIONS              = MQOO-INPUT-SHARED     +   
                                   MQOO-FAIL-IF-QUIESCING   
                                                             
 MOVE MQOT-Q                    TO MQOD-OBJECTTYPE.         
                                                             
 CALL 'MQOPEN'                USING WS-HCONN                 
                                    MQOD                     
                                    WS-OPTIONS               
                                    WS-HOBJ                 
                                    WS-COMPCODE             
                                    WS-REASON.               
-----------------------------------------------------------------
MQGET:
MOVE MQMI-NONE                TO MQMD-MSGID                 
MOVE MQCI-NONE                TO MQMD-CORRELID             
MOVE LENGTH OF WS-MQ-DATA                                   
                              TO WS-BUFFER-LENGTH           
                                                           
COMPUTE MQGMO-OPTIONS          = MQGMO-SYNCPOINT +         
                                 MQGMO-WAIT      +         
                                 MQGMO-ACCEPT-TRUNCATED-MSG.
                                                           
MOVE W040-WAIT-INTERVAL       TO MQGMO-WAITINTERVAL.       
                                                           
CALL 'MQGET'               USING WS-HCONN                   
                                 WS-HOBJ                   
                                 MQMD                       
                                 MQGMO                     
                                 WS-BUFFER-LENGTH           
                                 WS-MQ-DATA                 
                                 WS-DATA-LENGTH             
                                 WS-COMPCODE               
                                 WS-REASON.
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Wed Sep 28, 2011 10:30 am    Post subject: Reply to: MQ Transaction records gets lost if the task abend
Reply with quote

Please learn how to use the code tags so that people willing to help might understand better Your code snippets..
( done it for You )
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Sep 28, 2011 11:49 am    Post subject:
Reply with quote

the exact details of you connection and get were helpful.

now we need to know the order of activities that occurred?

You say the program abended. what do you mean? what actually is occuring?

you do realize that you need to issue the ROLLBACK before the task completes/terminates due to the ?ABEND?.

if your task terminates, due to an unHANDLED Condition, before the ROLLBACK is issued,
you are going to lose the message.
Back to top
View user's profile Send private message
Govardhana krishna

New User


Joined: 29 Apr 2008
Posts: 9
Location: INDIA

PostPosted: Wed Sep 28, 2011 12:04 pm    Post subject:
Reply with quote

The program abend - i mean if any SQL statement fails [for now i forcefully fail it to test this scenario], then the program enters the handle-error routine and it gives an EXEC CICS SYNCPOINT ROLLBACK END-EXEC ONLY . AND NOT JUST ROLLBACK.

HOPE i answered your question..
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Sep 28, 2011 12:31 pm    Post subject:
Reply with quote

ok, now we have entered that phase of debugging,
where the programmer can prove that the operating system has a bug.

if you are indeed
OPEN
GET
SQL
SYNCPOINT/ROLLBACK

then their is a bug in either CICS, MQS or both.

but we both know that is bullshit.

so, find where you are issuing a SYNCPOINT/COMMIT
or exiting the program prior to issuing the rollback.

The problem lies in your code,
which we do not have (and really do not want).
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Sep 28, 2011 12:44 pm    Post subject:
Reply with quote

are you sure the queue is defined as other queues are defined,
where a destructive get can be reversed with a rollback?

are there any other tasks that could be draining the queue?

is your program invoked via MQ ATI and you are possibly missing the task that actually removes the message?
Back to top
View user's profile Send private message
Govardhana krishna

New User


Joined: 29 Apr 2008
Posts: 9
Location: INDIA

PostPosted: Wed Sep 28, 2011 12:57 pm    Post subject:
Reply with quote

Hi please see my answers in Red beside your question below.

are you sure the queue is defined as other queues are defined, - Yes

where a destructive get can be reversed with a rollback? - Dont know
are there any other tasks that could be draining the queue? -No

is your program invoked via MQ ATI and you are possibly missing the task that actually removes the message? - yes for the first part but No for you second aprt
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Sep 28, 2011 2:57 pm    Post subject:
Reply with quote

after you have investigated (researched) the answer to:
Quote:
where a destructive get can be reversed with a rollback?

and you Do know
and the answer is yes

then we are back to:
Quote:
The problem lies in your code
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 990
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Mon Oct 03, 2011 1:30 pm    Post subject:
Reply with quote

dbzTHEdinosauer wrote:

you do realize that you need to issue the ROLLBACK before the task completes/terminates due to the ?ABEND?.

if your task terminates, due to an unHANDLED Condition, before the ROLLBACK is issued,
you are going to lose the message.


If an MQ message is retrieved with MQGMO-SYNCPOINT, there is no requirement to ROLLBACK. Where a task abends without having issued a SYNCPOINT which committed the unit-of-work, MQ will reinstate the message on the queue in the location it originally occupied.

It strikes me that you are likely setting MQGMO-SYNCPOINT in a different area of memory that is being used in the MQGET.

Garry.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Oct 03, 2011 2:38 pm    Post subject:
Reply with quote

Garry,
what you said is true,
but his task is not ABENDing,
as we who use terminology correctly, mean ABEND.

his program is reacting to a non-zero SQLCODE return
and entering a routine which does a syncpoint rollback.

regardless,
what you said about the option being set and the option used in the instruction
are probably true.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Java & MQSeries All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts Detailed Transaction History report f... Kyle Carroll CICS 5 Tue Oct 18, 2016 12:42 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us