Posted: Mon Oct 19, 2009 9:48 am Post subject: ESQL - Java Procedure - LifeCycle of Java Variables
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 ?
Posted: Mon Oct 19, 2009 10:23 am Post subject: Re: ESQL - Java Procedure - LifeCycle of Java Variables
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?
all message flows within an execution group process can share class variables (aka "static fields"); message flows in separate execution groups do not.
"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.
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