|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQSeries.NET and Transactions |
« View previous topic :: View next topic » |
Author |
Message
|
hayessj |
Posted: Tue Jan 14, 2003 2:32 am Post subject: MQSeries.NET and Transactions |
|
|
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 |
|
 |
bower5932 |
Posted: Tue Jan 14, 2003 5:54 am Post subject: |
|
|
 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 |
|
 |
hayessj |
Posted: Tue Jan 14, 2003 6:11 am Post subject: |
|
|
Newbie
Joined: 14 Jan 2003 Posts: 2
|
Doh! That sorts it out.
Thanks a million. |
|
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
|
|
|
|