geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Russell Collins <>
Subject EJB Life Cycle
Date Tue, 23 Mar 2010 02:03:48 GMT
I have been thinking about best practices with Geronimo.  One of the things that I have been
thinking about is the life of EJB's inside the EJB container.  I am wondering if I should
be setting used EJB's to null when I am done with them or should I just let the container
handle it.  Example Code:

public class MyEJB implements IMyEJB

   private IAnotherEJBLocal m_anotherEJB;

  // Do some stuff with m_anotherEJB;

   protected void finalize()
     m_anotherEJB = null;  //  Should I do this or let Geronimo handle it


Should I be including the finalizer code as I have it?  Should I just let Geronimo handle
the life cycle?  Is there a different/better way to handle this?  Any philosophical insight
would be greatly appreciated.  Thanks.

Russell Collins
Sr. Software Engineer
McLane Advanced Technology

CONFIDENTIALITY NOTICE: The information contained in this electronic mail (email) transmission
(including attachments), is intended by MCLANE ADVANCED TECHNOLOGIES for the use of the named
individual or entity to which it is addressed and may contain information that is privileged,
confidential and/or protected as a trade secret. It is not intended for transmission to, or
receipt by, any individual or entity other than the named addressee(s). If you have received
this email in error, please delete it (including attachments) and any copies thereof without
printing, copying or forwarding it, and notify the sender of the error by email reply immediately.

View raw message