How to get a reference to a particular Bean in memory?

Discussions

EJB design: How to get a reference to a particular Bean in memory?

  1. How do i get a reference to a particular Enterprise Bean, which is in memory currently.
    Assume that there are 3 session beans currently in memory, all are of same
    session bean type. The 3 beans are providing different services based on
    certain data in database. Suppose if i need a reference to 3rd session bean,
    which is in memory, how to get that reference.
  2. You should use SessionContext.getEJBObject() to get a
    reference.