|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How to rollback putting messages in queue? |
« View previous topic :: View next topic » |
Author |
Message
|
Kumar Nadar |
Posted: Wed Nov 14, 2001 3:03 am Post subject: |
|
|
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 |
|
 |
EddieA |
Posted: Wed Nov 14, 2001 6:28 am Post subject: |
|
|
 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 |
|
 |
bower5932 |
Posted: Wed Nov 14, 2001 3:05 pm Post subject: |
|
|
 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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|