1 Reply Latest reply on Feb 25, 2003 10:55 AM by Adrian Brock

    Stateful Session EJB lifecycle

    Patrik Rosqvist Newbie

      Hi!

      Is it possible in JBoss (3.0.4) to determine if a stateful session EJB exists (passivated or otherwise) without calling one of it's business methods?

      My interpretation of Sun's EJB specs is that by calling the EJB Handle object's getEJBObject() the EJB object would be in the state "exists and referenced" (this according to EJB specification 2.0 pdf). However if the stateful session EJB object has been passivated and then removed, the getEJBObject() on the handle still succeeds. It is only when you perform an actual business method invocation that you get the NoSuchObjectException.

      I'm not sure here but when I searched the JBoss source code I found the method public Object getStatefulSessionEJBObject(Object id) in the class IIOPContainerInvoker. There the POA's method create_reference_with_id is called, and the documentation for this method says that no activation is done for the object... I'm guessing this is why no error occurs when you call getEJBObject on a removed EJB.

      Is this a bug or is this functionality by design?

      Regards,
      Patrik