0 Replies Latest reply on Sep 19, 2008 8:48 PM by jej2003

    Newbie Questions

    jej2003

      I am trying to understand how EJB components (SLSB, SFSB, MDB) work. If I have an MDB that has a reference to a SLSB and a SFSB like:

      public class TestMDB implements MessageListener {
       @EJB
       private TestSLSB slsb;
       @EJB
       private TestSFSB sfsb;
       public void onMessage(Message msg){
      ...
      


      I had thought that the SLSB was pulled from a pool of available objects (so could be the same instance but not necessary) while the SFSB would always be the same instance no matter how many times the onMessage was called so long as the MDB remained in memory, is this not the case? One of the developers I work with was telling me that the SLSB and SFSB would both be the same instances no matter how many times the onMessage was called. If this were the case I am not sure I completely understand what the difference between a SLSB and SFSB would be. Additionally it would help to understand when injection occurs and for SFSB vs SLSB.

      If anyone can help me figure out these questions I'd greatly appreciate it.