View previous topic :: View next topic
|
Author |
Message |
Govardhana krishna
New User
Joined: 29 Apr 2008 Posts: 9 Location: INDIA
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Govardhana krishna
New User
Joined: 29 Apr 2008 Posts: 9 Location: INDIA
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Govardhana krishna
New User
Joined: 29 Apr 2008 Posts: 9 Location: INDIA
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
|