• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

EJB-StatefulSessionBean

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
Stateful sessionBean are dedicated to one client for entire life cycle.
1. Then how the instaces are served to the client?
2. Single instance is served to enire life cycle or the instance is swapped?
thanx
som
 
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When a client invokes the create method on an statefull EJB home, it�s life cicle begins, the container than invokes newInstance() on the bean class, creating a new instance of it,then the container invokes setSessionContext and finally ejbCreate once the ejbCreate has finished the container than returns the ejb remote reference to the client.
About swap I think that it can be implemented and also some kind of pool using cache memory but that�s a vendor specific implementation, but one thing I think most vendors do is passivating the bean when the bean instance is not servicing methods from the client to preserve resources.
 
reply
    Bookmark Topic Watch Topic
  • New Topic