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 » WebSphere Message Broker (ACE) Support » ATOMIC BLOCK Question

Post new topic  Reply to topic
 ATOMIC BLOCK Question « View previous topic :: View next topic » 
Author Message
Cho Chul-hwan
PostPosted: Thu May 09, 2013 9:16 pm    Post subject: ATOMIC BLOCK Question Reply with quote

Newbie

Joined: 05 May 2013
Posts: 8

Hi~

recently, I started WMB 7.0

i get DB data using shared row and i use ATOMIC block

but every time statement execute in atomic block

here is my code :

---- Module Begin ----
... (other code)
vanRoute : BEGIN ATOMIC

CALL getVanRouteInfoFromDb();

END vanRoute;
...(other code)
---- Module End -----

I want to execute just one at first message is sented
how to implement?

please help me....

and i'm not good at english so, the sentence is not perfect.^^;;
Back to top
View user's profile Send private message
huwgb
PostPosted: Thu May 09, 2013 9:36 pm    Post subject: Reply with quote

Novice

Joined: 07 May 2013
Posts: 21

From my understanding you wish to do the following:

Send many messages to message flow
Have special processing in the database the first time a message hits the flow
Ignore the database processing for following messages...

ATOMIC means that when multiple instances of a flow are deployed, only one instance at a time will have access to that code block, the others will wait until that instance has finished.

This can be done by adding a new GLOBAL SHARED VARIABLE at the end of the ATOMIC block.
Code:

DECLARE hasBeenRun SHARED BOOLEAN;

IF NOT hasBeenRun THEN
vanRoute : BEGIN ATOMIC

CALL getVanRouteInfoFromDb();
SET hasBeenRun = TRUE;
END vanRoute;
END IF;


Note, this code has not been tested and I can not guarantee I got the syntax correct, look up global shared variables for some hints.

Also Note:
If the message flow is restarted or the execution group is restarted, the variable will be set to false so the getVanRouteInfoFromDb statement will be called again
Back to top
View user's profile Send private message
Cho Chul-hwan
PostPosted: Thu May 09, 2013 11:18 pm    Post subject: Thank you Reply with quote

Newbie

Joined: 05 May 2013
Posts: 8

Thank you for your answer.

it is helpful for me to understand Atomic Block.
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 » WebSphere Message Broker (ACE) Support » ATOMIC BLOCK Question
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.