This week's book giveaway is in the HTML/CSS/JavaScript forum.
We're giving away four copies of Practical SVG and have Chris Coyier on-line!
See this thread for details.
Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Bean instances

 
Rajib Sarma
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Are the EJB instances of Statefull EJBs and Entity EJBs reused? If so, how? Please explain.
Thanks
-Rajib
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When the container gets a request for a certain EJB Object he looks if there is an associated bean object. If he don't finds one he takes it out of the pool he holds. These instacens are created when the app is started. If the bean is no longer needed by the EJB object he releases it and it can be used by other requests.
The lifecycle of a stateful session bean is:
|--------------ejbRemove()------
| |
non-existent ---> create() ----> method-ready
| |
| ejbPassivate()
| |
---------- Exception passive
 
Chintan Rajyaguru
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Additionally mastering EJB II on
http://theserverside.com
has life cycle diagrams of all kinds of EJBs
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!