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 Transaction rollback

Post new topic  Reply to topic
 MQSeries.NET and Transaction rollback « View previous topic :: View next topic » 
Author Message
doug
PostPosted: Mon Aug 09, 2004 6:34 am    Post subject: MQSeries.NET and Transaction rollback Reply with quote

Novice

Joined: 27 May 2003
Posts: 11

I'm having some problems getting messages received under syncpoint to rollback. I'm sure I'm doing something dumb, but it eludes me at the moment.

Scenario is 5.3 client on WinXP, queue manager on 5.1 server in Win2K. Code snippet as follows:-

Code:

using IBM.WMQ;

MQQueueManager   m_oMQMgr = null;
MQQueue         m_oMQ = null;
MQEnvironment.Channel = "CHANNEL1";
MQEnvironment.Port = 1414;
MQEnvironment.Hostname = "MYHOST";

m_oMQMgr = new MQQueueManager();
m_oMQMgr.Connect();

MQMessage           mqMsg=new MQMessage();
MQGetMessageOptions mqGMO = new MQGetMessageOptions();
mqGMO.Options  = MQC.MQGMO_NO_WAIT +
                            MQC.MQGMO_CURRENT_VERSION +
                            MQC.MQGMO_SYNCPOINT;
m_oMQ.Get( mqMsg, mqGMO );
...
m_oMQMgr.Backout();


The message disappears from the queue after the Get and does not get put back on the queue after the Backout. I've tried with persistent and non-persistent messages and the result is the same.

Any clues?

Thanks,
Doug
Back to top
View user's profile Send private message
JasonE
PostPosted: Wed Aug 25, 2004 4:19 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

Are you still having the problem (I was away when this was posted)?
Back to top
View user's profile Send private message
doug
PostPosted: Wed Aug 25, 2004 5:10 am    Post subject: MQSeries.NET and Transaction rollback Reply with quote

Novice

Joined: 27 May 2003
Posts: 11

I'm still having the problem. In addition to the mentioned configuration, I've also tried on a 5.3 server connecting to the 5.1 queue manager and also connecting to a local queue manager on the 5.3 server. I can't get messages to rollback in any configuration.

Either the syncpoint option is being ignored for some reason on the Get, or an implicit Commit is happening (I'd be suprised if it was the latter)

Any pointers would be gratefully received
Back to top
View user's profile Send private message
JasonE
PostPosted: Wed Aug 25, 2004 5:43 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

Have you got a small testcase I could try here? Alternatively you could email me a client side trace if you dont mind getting it - Just let me know where to download it from, or PM me and I'll let you know my email addr
Back to top
View user's profile Send private message
bower5932
PostPosted: Wed Aug 25, 2004 6:21 am    Post subject: Reply with quote

Jedi Knight

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

I just gave this a try using WMQ 5.3 CSD7. I tried it both in bindings mode and in client mode and both of them either rolled back or committed successfully when asked to.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
fjb_saper
PostPosted: Wed Aug 25, 2004 12:34 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

looking at your code snippet I could not find where you defined the queue.
I just can't believe that you would be able to do a get on a null object:
Quote:
MQQueue m_oMQ = null;
MQEnvironment.Channel = "CHANNEL1";
MQEnvironment.Port = 1414;
MQEnvironment.Hostname = "MYHOST";

m_oMQMgr = new MQQueueManager();
m_oMQMgr.Connect();

MQMessage mqMsg=new MQMessage();
MQGetMessageOptions mqGMO = new MQGetMessageOptions();
mqGMO.Options = MQC.MQGMO_NO_WAIT +
MQC.MQGMO_CURRENT_VERSION +
MQC.MQGMO_SYNCPOINT;
m_oMQ.Get( mqMsg, mqGMO );


Are you trapping any of the errors ?
Do you perform a rollback if an error occurs or just exiting the app. ?

Hope it helps some.
Back to top
View user's profile Send private message Send e-mail
doug
PostPosted: Thu Aug 26, 2004 12:47 am    Post subject: Reply with quote

Novice

Joined: 27 May 2003
Posts: 11

In my enthusiasm to cut down the code snippet to a readable level, I missed out the crucial:-

Code:

m_oMQ = m_oMQMgr.AccessQueue(txtQueue.Text ,
MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_OUTPUT + MQC.MQOO_INPUT_AS_Q_DEF);


after the connect.

Gets do work, they just don't rollback. All errors are trapped and I don't see anything reported (unless I do a MQQueueManager.Begin....but then it says it isn't supported for local transactions)[/code]
Back to top
View user's profile Send private message
JasonE
PostPosted: Thu Aug 26, 2004 2:29 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

For reference, the problem (I was emailing Doug) was the following:
Quote:

The trace shows you arent using syncpoint and hence the MQGET is committed immediately!

Code:
| GMO Options   {+008} | 00000005                                   
|                      | 00000001 MQGMO_WAIT (Wait)                 
|                      | 00000004 MQGMO_NO_SYNCPOINT (No syncpoint)


Your code however is different!

MQMessage mqMsg=new MQMessage();
MQGetMessageOptions mqGMO = new MQGetMessageOptions();
mqGMO.Options = MQC.MQGMO_NO_WAIT + MQC.MQGMO_CURRENT_VERSION + MQC.MQGMO_SYNCPOINT;
m_oMQ.Get( mqMsg, mqGMO );

However...

MQC.MQGMO_CURRENT_VERSION isnt a valid MQGMO Option field! (It goes in the Version field)

This results in

MQC.MQGMO_NO_WAIT + MQC.MQGMO_CURRENT_VERSION + MQC.MQGMO_SYNCPOINT ==
0 + 3 + 2 == 5
5 == MQGMO_WAIT | MQGMO_NO_SYNCPOINT
Back to top
View user's profile Send private message
doug
PostPosted: Thu Aug 26, 2004 2:56 am    Post subject: Reply with quote

Novice

Joined: 27 May 2003
Posts: 11

Doh! I gracefully accept the Wally of the week award.

Thanks Jason
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 Transaction rollback
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.