Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

State of Stateful Session Beans

 
Dhananjay Ghanwat
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How is the state of the Stateful session bean maintained. Like how an HttpSession can be maintained using URL rewriting or cookies.
Similary how does EJB container identifies the Stateful Session Bean for a unique client.

Also what would be the timeout period for a Stateful Session Bean.

Thank you
Dhananjay G.
 
Ramakrishnan thiyagarajan
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
EJBcontainer maintains the stateful session bean state.if any webbased clinet accesses EJB the EJBclient session is maintained by HTTPsession.if the session period is out, container maintains a beans state.
 
Dhananjay Ghanwat
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ramakrishnan,

I would like to know the concept of how does the EJB Container manages the state.

Regards,
Dhananjay
 
Stan Sokolov
Ranch Hand
Posts: 120
Hibernate IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The biggest difference between the stateful session bean and the other bean types is that stateful session beans don't use instance pooling. Stateful session beans are dedicated to one client for their entire life, so there is no swapping or pooling of instances.[12] Instead of pooling instances, stateful session beans are simply evicted from memory to conserve resources. The EJB object remains connected to the client, but the bean instance is dereferenced and garbage collected during inactive periods. This means that a stateful bean must be passivated before it is evicted to preserve the conversational state of the instance, and it must be activated to restore the state when the EJB object becomes active again.

[12] Some vendors use pooling with stateful session beans, but that is a proprietary implementation and shouldn't impact the specified life cycle of the stateful session bean.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic