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 » thread safety of environment tree variables

Post new topic  Reply to topic
 thread safety of environment tree variables « View previous topic :: View next topic » 
Author Message
fenway_frank
PostPosted: Fri Mar 30, 2012 1:15 pm    Post subject: thread safety of environment tree variables Reply with quote

Apprentice

Joined: 21 Oct 2011
Posts: 43
Location: Boston, MA USA

hello.
is the environment tree structure (especially the 'variables' subtree) thread safe? if i assign a variable within an esql node, i presume the assignment itself is thread safe within the execution of the message flow. most important, subsequent requests/instantiations of same msgflow will create a separate environment tree. that is my understanding, pls confirm.

also, why doesn't jcn support access to the same environment tree?
Back to top
View user's profile Send private message
mgk
PostPosted: Fri Mar 30, 2012 1:18 pm    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Quote:
is the environment tree structure (especially the 'variables' subtree) thread safe


Yes

Quote:
if i assign a variable within an esql node, i presume the assignment itself is thread safe within the execution of the message flow


Yes

Quote:
most important, subsequent requests/instantiations of same msgflow will create a separate environment tree


Yes, a new Environment tree is created for each message through a flow.

Quote:
that is my understanding, pls confirm


Done.

Quote:
why doesn't jcn support access to the same environment tree?


It does, look again at the API.


Kind Regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
fenway_frank
PostPosted: Fri Mar 30, 2012 1:25 pm    Post subject: Reply with quote

Apprentice

Joined: 21 Oct 2011
Posts: 43
Location: Boston, MA USA

@mgk - thx for quick reply. if i increase the number within msgflow "additional instances" property > 0, my understand is that (1+additional instances) message flow instances are instantiated at eg startup and ready to receive traffic. how, if at all, does this effect the behavior of the environment tree? thx!
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Mar 30, 2012 1:38 pm    Post subject: Reply with quote

Grand High Poobah

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

fenway_frank wrote:
@mgk - thx for quick reply. if i increase the number within msgflow "additional instances" property > 0, my understand is that (1+additional instances) message flow instances are instantiated at eg startup and ready to receive traffic. how, if at all, does this effect the behavior of the environment tree? thx!

I doesn't because as stated the tree is threadsafe...
Now if you are playing with Shared variables, then the content (of the shared variables) is no longer "thread-safe" as it can be changed by the other instances of the flow...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
fenway_frank
PostPosted: Fri Mar 30, 2012 1:41 pm    Post subject: Reply with quote

Apprentice

Joined: 21 Oct 2011
Posts: 43
Location: Boston, MA USA

yes, understood that shared variables are another matter altogether.
thx for answering my questions.
Back to top
View user's profile Send private message
fenway_frank
PostPosted: Fri Mar 30, 2012 6:02 pm    Post subject: Reply with quote

Apprentice

Joined: 21 Oct 2011
Posts: 43
Location: Boston, MA USA

Just to be crystal clear, my prior questions were specifically targeting the Environment tree and not the Local Environment Tree. Both have concept of variables "scratch pad" section but i intend to use Environment.variables (not LocalEnvironment.variables) to carry custom data across the message flow.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sat Mar 31, 2012 6:14 am    Post subject: Reply with quote

Grand High Poobah

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

fenway_frank wrote:
Just to be crystal clear, my prior questions were specifically targeting the Environment tree and not the Local Environment Tree. Both have concept of variables "scratch pad" section but i intend to use Environment.variables (not LocalEnvironment.variables) to carry custom data across the message flow.

It is thread safe and different for each instance of the flow.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Sat Mar 31, 2012 10:03 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

fenway_frank wrote:
Just to be crystal clear, my prior questions were specifically targeting the Environment tree and not the Local Environment Tree. Both have concept of variables "scratch pad" section but i intend to use Environment.variables (not LocalEnvironment.variables) to carry custom data across the message flow.


Just to be crystal clear.

BOTH TREES ARE COMPLETELY THREAD SAFE.
Back to top
View user's profile Send private message
rekarm01
PostPosted: Sun Apr 01, 2012 3:44 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

mqjeff wrote:
Just to be crystal clear.

BOTH TREES ARE COMPLETELY THREAD SAFE.

Before anyone asks, the Root and ExceptionList trees are also completely thread safe.

However, this only applies to threads created by the broker itself. Within a message flow instance, an external procedure, non-ESQL compute node, or user-defined extension could create its own threads, unbeknownst to the broker, but these non-broker threads must not use the broker API to access any message trees.
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 » thread safety of environment tree variables
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.