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 » Using shared variables with additional instances

Post new topic  Reply to topic
 Using shared variables with additional instances « View previous topic :: View next topic » 
Author Message
psandip
PostPosted: Mon Oct 19, 2009 1:07 am    Post subject: Using shared variables with additional instances Reply with quote

Novice

Joined: 11 Aug 2006
Posts: 17

Hi,

I am using a shared variable for my message flow. The message flow generated a filename based on timestamp and assigns this name to the shared variable. A check is made within the compute node to see whether the shared variable is null or does it have a value. If it is null, the the filename is generated and assigned to it else, no need to assign a new name. Now suppose 10 instances of this message flow is to be deployed. once the shared variable is populated with a filename, can the other 9 flows access this value or they see it as null?
_________________
With Best Regards,
Sandeep
Back to top
View user's profile Send private message
WMBDEV1
PostPosted: Mon Oct 19, 2009 1:37 am    Post subject: Reply with quote

Sentinel

Joined: 05 Mar 2009
Posts: 888
Location: UK

What does the manual say?

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ak04980_.htm
Back to top
View user's profile Send private message
smdavies99
PostPosted: Mon Oct 19, 2009 1:42 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Did you try it for yourself? This is a good way to learn.

Also, don't double post.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
psandip
PostPosted: Mon Oct 19, 2009 1:48 am    Post subject: Reply with quote

Novice

Joined: 11 Aug 2006
Posts: 17

@WMBDEV1

Looked into the manul and checked that shared variables are shared across instances. Thanks.

@ smdavies99

I didn't double post on purpose. I got a timeout in my first attempt and then wnet back and resubmitteed. Then I saw the entire thing being doubly posted. I even tried to delete the earlier post but couldn't.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Oct 19, 2009 2:53 am    Post subject: Reply with quote

Grand High Poobah

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

You might also want to look up the word ATOMIC.
When working with a shared variable and multiple instances of the flow you have to consider thread safety...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Sam Uppu
PostPosted: Wed Oct 21, 2009 7:41 am    Post subject: Reply with quote

Yatiri

Joined: 11 Nov 2008
Posts: 610

To add it to the FJs point, you need to use BEGIN ATOMIC and END ATOMIC in your flow.

If I remember correctly, there should be a sample out there in the WMB examples in Toolkit 6.1/ 6.0

Thanks.
Back to top
View user's profile Send private message
MQEnthu
PostPosted: Wed Oct 21, 2009 11:18 pm    Post subject: Reply with quote

Partisan

Joined: 06 Oct 2008
Posts: 329
Location: India

psandip wrote:
Looked into the manul and checked that shared variables are shared across instances.


Also note that you cannot share variables across execution groups.
_________________
-----------------------------------------------
It is good to remember the past,
but don't let past capture your future
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 » Using shared variables with additional instances
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.