Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Bean instances  RSS feed

 
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!