This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to close a session

 
Abhishek Asthana
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have made a session using stateful session bean. Please tell me how to close the session when user logs out.
Thanks
Abhishek
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Handle the code in ejbRemove and make sure client calls remove before logging out. However if the client session expires, or the client loses the connection with the bean before calling remove, then you are still safe, because the container will first passivate the bean and later on will remove the bean calling ejbRemove anyway. As you can see you might not care about calling remove at all, but by doing so you give the container a hint that the SFSB could be discharged at any time.
Regards.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic