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

Rollback does not remove messages?


IBM Mainframe Forums -> Java & MQSeries
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Susan Talbot

New User


Joined: 17 Dec 2010
Posts: 36
Location: KY

PostPosted: Fri Sep 23, 2011 11:38 pm
Reply with quote

I wrote an MQ program that does a commit every 9999 messages (because the queue manager has max uncommitted messages set to 10000).
I am looping thru a file, putting each record on the queue and I get to 9999 and then commit. Then say I am on record 11000 and something fails. I issue a rollback and the program ends. I look in the queue and there are 9999 messages. I can see why this happens, since a MQCMIT makes the messages permanent but I don't know what to do. If we restart the job it will put the first 9999 back on the queue again which would be very bad.

How do we either delete the messages or restart at record 10000? I want to know how MQ can do this for me but I am not seeing anything in the manual. Anyone know?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Fri Sep 23, 2011 11:43 pm
Reply with quote

Hello,

Is this a dedicated queue or do multiple processes put info in thes queue?

If the queue is only for this process, suggest you empty the queue when this process begins and then there will be no need to restart "in the middle".
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Sat Sep 24, 2011 12:00 am
Reply with quote

Follow on:

Keep in mind that the whoe reason for the COMMIT is to make sure theings that are "done" are NOT rolled back. . .

There would be no reason to ever commit if the content would automatically be rolled back. . .
Back to top
View user's profile Send private message
Susan Talbot

New User


Joined: 17 Dec 2010
Posts: 36
Location: KY

PostPosted: Sat Sep 24, 2011 12:07 am
Reply with quote

The only reason I do the commit is because of the max uncommitted messages limit. 9999 messages is not my 'unit of work' an entire file is my unit of work but we have been told the limit cannot be raised.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Sat Sep 24, 2011 12:31 am
Reply with quote

Hello,

Understood, but the queston remains - does anything other than this process use this particular queue?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Sat Sep 24, 2011 1:12 am
Reply with quote

1. are you using RRSAF?

Normally, one would keep a counter,
or better still load the file into a db2 table.
this would be your unit of work
  • fetch from db2 cursor
  • delete from db2 cursor
  • PUT to MQS
  • commit(based on fetch/delete/put count)


when you start your program, open cursor and start your loop

or

keep a counter in memory
  • read from file
  • put to mqs
  • add 1 to counter
  • commit on cycle / write counter to a second file


when you start the program read the second file,
if it is empty start from begining of first file
if not empty, save counter, close first file.
read second file number of counter times,
start your loop.

or

you can keep the counter in yet another db2 table.

but to use db2, you need to make an attachment to rrsaf.

this kind of stuff should be in your site standards.
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 Synchpoint Rollback CICS 1
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Remove leading zeroes SYNCSORT 4
No new posts How to remove block of duplicates DFSORT/ICETOOL 8
No new posts To Remove spaces (which is in hex for... JCL & VSAM 10
Search our Forums:

Back to Top