Stateless EJB Global Variable Timeout question
843829Jan 10 2003 — edited Jan 13 2003Hi,
In this Stateless EJB:
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
public class HelloBean implements SessionBean
{
int testnum = 0;
public void ejbCreate()
{
}
public void ejbActivate()
{
}
public void ejbPassivate()
{
}
public void ejbRemove()
{
}
public void setSessionContext(SessionContext ctx)
{
}
public String sayHello(String param)
{
testnum++;
System.out.println("Someone call me!" + testnum);
return "Hello " + param + "! This is an EJB. The current time is " + new java.util.Date() + " The Number is:" + testnum;
}
}
Why "testnum" will keep the value for about 1.5 minutes? If I call this EJB within the 1.5 mins the "testnum" will add the previous value. I don't understand. Because its a stateless session EJB, everytime when I call it the value should be reset.
How can I fix this problem?
Please help
Thanks
Kenny