• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Stateful Session bean and Session

 
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
How does a stateful session bean maintain its session ?
Hari
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic