When bean passivated what happens to EJBObject

Discussions

EJB programming & troubleshooting: When bean passivated what happens to EJBObject

  1. hi,
    When bean passivated the same EJBObject can be used by some other client. Try to give scenerio for both session and entity beans or it's totally container dependent.
  2. Bean passivation has nothing to do with EJBObject. EJBObject is a remote stub provided for client to talk to EJB-container. Now, the container itself keeps a number of objects that correspond to those client stubs and are used by container to service client remote calls. This container-side objects might get passivated and activated as container's own needs dictate. They also might be populated with a new set of data from time to time, so that different clients, using their different remote stubs, will in fact talk to the same container-side object without knowing it because these objects may acquire absolutely new identities with every call. Whenever client makes a remote call through his EJBObject, container may pick any free bean object, populate it with client-related data and service client request. Stateless session beans obviously don't need this last stage.