posted 19 years ago
It's basically about who is accessible and who is not. As you know, a Stateless Session bean's creation is not linked to client calls in any way. The container creates the Stateless Session bean whenever it sees fit. When it does this, there will be no EJB Object, since there is no client yet. But there has to be a home already existing for this session bean gets created in the first place. Consequently, setSessionContext() allows you to get a reference to your home object.
Though the Stateless Session objects are pooled, it does not mean that they are de-linked from their home. They still are within the domain of and within the control of the Home that created them.
Regards,<br />Subhash Bhushan.