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 » Environment Variables Behavior

Post new topic  Reply to topic
 Environment Variables Behavior « View previous topic :: View next topic » 
Author Message
mbsa
PostPosted: Wed Jun 12, 2013 4:29 pm    Post subject: Environment Variables Behavior Reply with quote

Apprentice

Joined: 04 Mar 2013
Posts: 41

Hello, I am using wmb8.0.0.2 and i created a serivice which has 3 operations.
So the service will have one main message flow with soap i/p and saop reply.And the main flow will have 3 subflows to handle catch,failure and timeout.There will also be 3 subflows for 3 operations.

If i create a environment.varaible.msgtype in 2 subflow of the 2 operations and try to acess this environment.varaible.msgtype in catch subflow which is common for all the opeartions.

How will the environment varaible behave when i hit 2 opeartions simultaneously.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Jun 12, 2013 5:31 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

The answer to this question lies in understanding what happens when you hit 2 operations simultaneously.
Back to top
View user's profile Send private message
mbsa
PostPosted: Thu Jun 13, 2013 3:59 am    Post subject: Reply with quote

Apprentice

Joined: 04 Mar 2013
Posts: 41

Hi Jeff,
When i hit 2 operations (xa and xb) simultaneously.The message type for xa opeartion will have environment variable Msgtype as xa and xb opeartion will have environment variable Msgtype as xb. When i try to access the the environment variable Msgtype in fault node which one (xa or xb) will be available. My question is ,there will be any clash while processing these operations simultaneously with same environment variable names.Or they are independent according to each opeartions thread.
Please advice.
Back to top
View user's profile Send private message
McueMart
PostPosted: Thu Jun 13, 2013 4:07 am    Post subject: Reply with quote

Chevalier

Joined: 29 Nov 2011
Posts: 490
Location: UK...somewhere

The Environment tree is thread scoped, so variables you set in it are ONLY visible to the current thread.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Thu Jun 13, 2013 4:09 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

You can make them all available, if you think about it long enough:

Code:
Environment.Variables.XA.Id = 123;
Environment.Variables.XB.Id = 456;


If you write:

Code:
Environment.Variables.Id = 123;
Environment.Variables.Id = 456;


Then 456 will be the value in your error handler. Therefore, don't use that construct if you want to evaluate both XA and XB.

If you have multiple flows, use Global Cache rather than Environment.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
mbsa
PostPosted: Thu Jun 13, 2013 5:12 am    Post subject: Reply with quote

Apprentice

Joined: 04 Mar 2013
Posts: 41

Code:

Environment.Variables.XA.Id = 123;
Environment.Variables.XB.Id = 456;


If i write like this,then in my common error handler i need a logic to pick which one based on XA or XB.I have 18 operations in my service.
Code:

Environment.Variables.Id = 123;
Environment.Variables.Id = 456;


Code:

Then 456 will be the value in your error handler.


Why you think there will be 456?
The operation is XA it will be 123
and if XB it will be 456 if Environment tree is thread scoped,as mentioned by McueMart.

Are they not thread scoped?Please advice.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Thu Jun 13, 2013 5:17 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

You have the technology, you can try it out.

Why post here since you can find this out for yourself through experimentation?

Environment is thread-scoped. Global Cache is not. Hence the recommendation.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Environment Variables Behavior
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.