0

I am working on a weam web application where the once the user logs in, the main (or landing) page calls 4 stateful session beans. So once the user logs in, there will be atleast 4 threads of stateful session beans created. The page also has a logout button. The logout component in the xhtml calls a POJO which has a logout method.

In the logout method, the following statement is executed:

Session.instance().invalidate();

Now the question is, will the 4 threads/instances of the stateful session beans which are created when the user logs in will be destroyed or not.

I am running this application on JBOSS 4.2.3, Seam 2.2.1 Final I am using JOSSO for authentication.

1 Answers1

0

Yes, they're all part of the same session. You're actually creating session scoped beans, not separate sessions.

Easy enough to check though. Create a method in each of the session beans and annotate them with @Destroy, when the annotated bean is destroyed, it will call this method.

@Destroy
public void callMeWhenIDie(){
log.debug("I'm melting, I'm melting" + this.someDefiningCharacteristic);
}
gebuh
  • 797
  • 14
  • 40