View previous topic :: View next topic
|
Author |
Message |
rakesh1155
New User
Joined: 21 Jan 2009 Posts: 84 Location: India
|
|
|
|
Hi,
I have a program which does and MQGET (with MQPMO_SYNCPOINT) from an MQ (say MQ-1).
Based on the paramters in the data in MQ-1, it reads records from DB2 table and puts the data read from table in another MQ (say MQ-2) and updates the status in the table.
Note: There could be 5000 records in DB2 for each paramater from MQ-1.
Now, after 1000 MQPUT (with MQPMO-SYNCPOINT option) on MQ-2, the program abends with MQ error 2024 (MQRC_SYNCPOINT_LIMIT_REACHED )
Is there a way to commit the changes both in MQ-2 and DB2 table, however, NOT losing the message in the MQ-1 ?
I hope I didn't sound vague and If I did, please let me know.
-Thanks,
Rakesh. |
|
Back to top |
|
|
Susan Talbot
New User
Joined: 17 Dec 2010 Posts: 36 Location: KY
|
|
|
|
you can do an explicit commit in both MQ and DB2. Why would you lose the meesage from MQ-1? Are you putting it in a working storage field when you et it off? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
you still have a problem because you complete unit-of-work
includes every db2 row effected by the msg on mq-1.
any commit you make will destroy the msg on mq1. and since you can only partially work the mq1 msg before committing the mq2 msg,
you need to save the mq1 msg (in a db2 table) as a restart parm when you commit.
that way you process the saved db2 row (with the msg) before you ever read mq1.
the last commit for a completely worked mq1 msg would be to update the db2 restart row as empty, forcing your processing logic to read mq1. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
This topic, by the way, is the best in several weeks.
someone actually created something,
has a problem (beyond not being able to read the manual),
and explained it well enough to provoke thought.
if we had 15 or 20 questions a day of this caliber,
this would be an interesting forum.
most of the time it is just depressing.
Thx rakesh1155,
you made my summer.... |
|
Back to top |
|
|
rakesh1155
New User
Joined: 21 Jan 2009 Posts: 84 Location: India
|
|
|
|
Thanks dbzTHEdinosauer!
I have seen numerous posts in this forum with improper explanation and get the answers of the same quality.
And this is what makes me try to explain my question at the fullest I can.
Coming back to the query,
I had suggested the same answer to the senior folks about saving the MQ1 msg on a db2 table.
But as it happens at most times, seniors often like to choose the difficult/complex way and solution implemented was:
the message read from MQ1 is written back to the MQ1 on reaching the syncpoint limit which then re-triggers the same transaction/program and this goes on.
For eg: For 5000 records,
after 1000 MQPUTs, the message read from MQ1 is written back to MQ1. and transaction ends.
Now there are 4000 records waiting to be processed, The message is read again and the process continues until it finishes all records. |
|
Back to top |
|
|
|