ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » How to rollback putting messages in queue?

Post new topic  Reply to topic
 How to rollback putting messages in queue? « View previous topic :: View next topic » 
Author Message
Kumar Nadar
PostPosted: Wed Nov 14, 2001 3:03 am    Post subject: Reply with quote

Newbie

Joined: 16 Oct 2001
Posts: 9

We are reading messages line by line from a flat file and putting it in the queue. Suppose there is an exception at 10 th line then how to ensure that the messages 1 to 9 that has been already put in the queue are rolled back.

Thanks in advance
Back to top
View user's profile Send private message
EddieA
PostPosted: Wed Nov 14, 2001 6:28 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

You would have to put all of the messages in a single unit of work.

Java.

On the 1st PUT (at least), ensure that the MQPMO_SYNCPOINT option is set. Then, all subsequent PUTs will be done under the same UOW.

You can then either expicitly commit or rollback, or let the system do it for you depending on how you program ends.

JMS.

On the createQueueSession, set the first parameter to 'true', transacted.

With JMS, you must always explicitly commit the messages. The default, even on a normal termination is to rollback.

Cheers,

_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
bower5932
PostPosted: Wed Nov 14, 2001 3:05 pm    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

I'd suggest taking a look at the mqsync.java sample in the Software Repository. It might be what you are looking for.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » How to rollback putting messages in queue?
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.