IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

MQ Transaction records gets lost if the task abends!


IBM Mainframe Forums -> Java & MQSeries
Post new topic   Reply to topic
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Sep 28, 2011 10:30 am
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
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
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
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
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
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
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

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Mon Oct 03, 2011 1:30 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Java & MQSeries

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts How to identify the transaction categ... IMS DB/DC 3
Search our Forums:

Back to Top