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
 

 

Rollback does not remove messages?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Java & MQSeries
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    Post subject: Rollback does not remove messages?
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

Site Director


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

PostPosted: Fri Sep 23, 2011 11:43 pm    Post subject:
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

Site Director


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

PostPosted: Sat Sep 24, 2011 12:00 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Sat Sep 24, 2011 12:31 am    Post subject:
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: 6967
Location: porcelain throne

PostPosted: Sat Sep 24, 2011 1:12 am    Post subject:
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    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 Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm
No new posts Remove junk values in a file and rite... KP1125 DFSORT/ICETOOL 2 Wed Jan 25, 2017 9:58 pm
No new posts Sort Card to Remove Duplicate records... raj4neo SYNCSORT 2 Wed Jan 25, 2017 4:44 am
No new posts Remove Special Characters from Mainfr... Rodger Zhang All Other Mainframe Topics 6 Wed Jul 06, 2016 1:12 am
No new posts ims program to put and get MQ messages fatenezzat COBOL Programming 1 Wed Feb 17, 2016 1:07 am


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