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 API Support » MQSeries.NET and Transactions

Post new topic  Reply to topic
 MQSeries.NET and Transactions « View previous topic :: View next topic » 
Author Message
hayessj
PostPosted: Tue Jan 14, 2003 2:32 am    Post subject: MQSeries.NET and Transactions Reply with quote

Newbie

Joined: 14 Jan 2003
Posts: 2

Hi,
I'm trying to use a transaction when writing a message to a queue with the MQSeries.NET package (great job btw.) . When I back out the transaction the message still gets written to the queue. Am I doing something really stupid here? Any thoughts greatly appreciated.

MQ.MQQueueManager mqm = new MQ.MQQueueManager(qmName);
MQ.MQQueue q = mqm.AccessQueue(qName, MQ.MQC.MQOO_OUTPUT | MQ.MQC.MQOO_INPUT_AS_Q_DEF);
MQ.MQMessage message = new MQ.MQMessage();
message.WriteString("Test Message");
q.Put(message);
mqm.Backout();
q.Close();

Thanks,
Seamus
Back to top
View user's profile Send private message
bower5932
PostPosted: Tue Jan 14, 2003 5:54 am    Post subject: Reply with quote

Jedi Knight

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

I've never messed with the MQSeries.NET. However, I don't see where you specify that your message is actually part of a unit of work. I would have expected to see something like:
Code:

MQMessage myMessage = new MQMessage();
myMessage.writeString("message text here");
myMessage.format = MQC.MQFMT_STRING;

MQPutMessageOptions pmo = new MQPutMessageOptions();
pmo.options = pmo.options | MQC.MQPMO_SYNCPOINT;
myQueue.put(myMessage, pmo);


Without specifying that the message is part of a unit of work, it will get put regardless of the commit/backout that you try.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
hayessj
PostPosted: Tue Jan 14, 2003 6:11 am    Post subject: Reply with quote

Newbie

Joined: 14 Jan 2003
Posts: 2

Doh! That sorts it out.

Thanks a million.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » MQSeries.NET and Transactions
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.