EJB programming & troubleshooting: Best Way To Handle Initialization of EJBs

  1. Best Way To Handle Initialization of EJBs (2 messages)


    I am trying to determine the best way to handle EJB initialization from a page-to-page basis. Would it be better to maintain my own cache/pool of initilized EJBs or rely on the app server to do this for me. I am curiose about this for both performance and usability reasons.

    Marc Boorshtein
    IDRS - http://idrs.sourceforge.net/
  2. It is the responsibility of the container to handle EJB initialization/destruction, so you shouldn't (and you can't) try to intervene.

    If you were referring to caching Home interfaces, then yes, you should definitely do that - unless the performance cost of making a JNDI lookup for the Home interface is acceptable in your application.
  3. When caching home objects, ahould a pool of homes be cached or shouldn't I worry about a single home instance being a bottleneck?