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 » General IBM MQ Support » Confusion: multiple syncpoints with a single MQCmit / MQBack

Post new topic  Reply to topic
 Confusion: multiple syncpoints with a single MQCmit / MQBack « View previous topic :: View next topic » 
Author Message
pcelari
PostPosted: Mon Oct 09, 2006 5:40 am    Post subject: Confusion: multiple syncpoints with a single MQCmit / MQBack Reply with quote

Chevalier

Joined: 31 Mar 2006
Posts: 411
Location: New York

Want to clarify my last bit of confusion over syncpoint - cmit.

My program read from a queue, do a little manipulation in the msg, and put it into a second queue. My current setting is like this:

...
gmo.Options = MQGMO_SYNCPOINT;
MQGET()
...

pmo.Options = MQPMO_SYNCPOINT;
MQPUT1(...)

if(Reason == MQRC_NONE)
{
MQCMIT(Hcon, &CompCode, &Reason);
}
else
{
MQBACK(Hcon, &CompCode, &Reason);
}

As there is no generic sycpoint, I have to use one for get and another one for put, at different points in the code. the code seems to work. But I'm not so sure if it is correct.

So the question:
Is the use of mutiple syncpoints with a single commit/backout correct?
_________________
pcelari
-----------------------------------------
- a master of always being a newbie
Back to top
View user's profile Send private message
Nigelg
PostPosted: Mon Oct 09, 2006 5:46 am    Post subject: Reply with quote

Grand Master

Joined: 02 Aug 2004
Posts: 1046

Yes.

An MQCMIT (MQBACK) commits (backs out) all msgs put/got since the last MQCMIT. A qmgr connection only has a single unit of work (UoW), begun when the first msg is put or got in syncpoint, and ended when MQCMIT or MQBACK is called.

The use of the MQGMO_SYNCPOINT and MQPMO_SYNCPOINT is to do the get and put in the UoW. Without that option the msg would be got/put outside syncpoint, i.e. immediately, and neither could be backed out if the other failed.

In your case, the GET and PUT of the msg are in the same UoW, so either they both succeed or neither does.
_________________
MQSeries.net helps those who help themselves..
Back to top
View user's profile Send private message
zpat
PostPosted: Mon Oct 09, 2006 5:47 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

The GMO and PMO SYNCPOINT options only start a new UoW if there is not one already in progress, otherwise they will join the current one.

You can't have two Units of Work on the same connection handle at the same time. All syncpointed operations will be under one U of W and they will all be commited or backed out at the same time.
Back to top
View user's profile Send private message
pcelari
PostPosted: Mon Oct 09, 2006 11:18 am    Post subject: Reply with quote

Chevalier

Joined: 31 Mar 2006
Posts: 411
Location: New York

Many thanks for the concise clarifications.

The manual seems to be less clear about this, or I haven't find it.
_________________
pcelari
-----------------------------------------
- a master of always being a newbie
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 » General IBM MQ Support » Confusion: multiple syncpoints with a single MQCmit / MQBack
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.