Show of hands, please.

I have a simple servlet that will be doing lots of stuff with a
stateless session bean.  I need to know what kind of reference to store
where.

As I see it, there are three things I can work with:

1. The session bean's EJBHome.
2. The session bean client reference itself.
3. The session bean's Handle.

What's the best practice in terms of stashing a reference to something
session related away in an instance variable?  My choices are:

1. Store the EJBHome; do a create() each time I want to use the session
bean (ick)
2. Get the client reference using (1) once in the init() method; store
the bean reference in an instance variable (what I'd like to do)
3. Get the Handle and store that; call getEJBObject() every time I need
the session bean (ick)

As I understand it, a Handle is, in some vague hand-waving way, more
"long-lived" than a bean reference.  Does that mean that I should not
store a bean reference if I expect to be up for a long time?  Finally,
what's the difference between doing Handle.getEJBObject() and
SessionBeanHome.create() in the case of a stateless session bean?

Furthermore, I can then store whatever comes out of the three steps
above in any of the following places:

1. System.properties
2. The current HttpSession
3. My own instance variable
4. A static variable

What's the standard practice here?

Cheers,
Laird

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to