Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Stateful Session bean and Session  RSS feed

 
Hari babu
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
How does a stateful session bean maintain its session ?
Hari
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure what you want to know.
Stateful Session Beans maintain state in memory and persist to some form of storage if the EJB Container passivates it. That is why all state in a Stateful Session Bean must be Serializable.
 
Hari babu
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How does the Session bean/ EJb container recognise the client when the client access the bean for the second time or the subsequent times ?
Hari
 
Lipman Li
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
before you call method of EJB, you must have the instance which implements remote/local interface.
then you call the method again, using the same instance, so that the EJB is still the original one(at least, looks like the same one. container may have mechanism to share EJBs).
the reference of instance may be kept in web tier session if we talk about web application.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!