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 » ESQL - Java Procedure - LifeCycle of Java Variables

Post new topic  Reply to topic
 ESQL - Java Procedure - LifeCycle of Java Variables « View previous topic :: View next topic » 
Author Message
integrated
PostPosted: Mon Oct 19, 2009 9:48 am    Post subject: ESQL - Java Procedure - LifeCycle of Java Variables Reply with quote

Newbie

Joined: 15 Oct 2009
Posts: 6

I am calling a Java procedure in my message flow

CREATE PROCEDURE myFunc(IN facility CHAR)
RETURNS CHAR
LANGUAGE JAVA
EXTERNAL NAME "com.util.MyUtil.myFunc"

I have couple of static variables (Maps) in MyUtil class which is used by myFunc.

MyUtil class is used in more than 1 Flow. What would be the lifcycle of these static fields in each flow. Question is

1)Will these static fields be shared across flows ? or
2)Each flow will have its own static instance of the java variable till the flow is restarted ? or
3)Each flow will have its own static instance of the java variable for each message passed through ?

Thanks for ur time
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Oct 19, 2009 9:52 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Everything you need to know about the lifetime of java variables is this.

Every ExecutionGroup is it's own JVM.
Back to top
View user's profile Send private message
rekarm01
PostPosted: Mon Oct 19, 2009 10:23 am    Post subject: Re: ESQL - Java Procedure - LifeCycle of Java Variables Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

integrated wrote:
1)Will these static fields be shared across flows? or
2)Each flow will have its own static instance of the java variable till the flow is restarted? or
3)Each flow will have its own static instance of the java variable for each message passed through?

  1. all message flows within an execution group process can share class variables (aka "static fields"); message flows in separate execution groups do not.
  2. "static" and "instance" are mutually exclusive; a field can be either a class variable ("static"), or an instance variable, but not both. The lifetime of a class variable corresponds to the loading and unloading of the class.
  3. No.
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 » ESQL - Java Procedure - LifeCycle of Java 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.