Hi,
I have a small problem with the bean I have deployed.
My Bean class looks in this way:
public class MyBean implements SessionBean {
public
String nam = new String();
int cnt = 0;
public void ejbCreate() {
}
public void ejbActivate() {
}
public void ejbPassivate() {
}
public void ejbRemove() {
}
public void setSessionContext(SessionContext ctx) {
}
public String getMessage() {
return (cnt++)+"";
}
}
I have deployed this bean as a Stateless session bean. Now, my client looks like:
public class MyCall {
public static void main(String ar[]) throws Exception {
Context ctx = new InitialContext();
Object obj = ctx.lookup("MyJndi");
MyHome home = (MyHome)PortableRemoteObject.narrow(obj,MyHome.class);
MyComponent comp = home.create();
System.out.println(comp.getMessage());
System.out.println(comp.getMessage());
System.out.println(comp.getMessage());
}
}
Now, every time I am executing the client, I am getting a sequence of higher numbers. i.e first time I am getting 0 1 2...next time 3 4 5 ...so on.
Is this a correct behaviour for a stateless session bean?
Srini