----- Original Message -----
From: Rickard �berg <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 31, 1999 4:22 PM
Subject: Re: Caching home interfaces
>> According to the new J2EE spec. this would not be recommended coding.
I didn't notice that restriction. It's true that some business method showed
the lookup process taking place, and this may imply that it would perform a
look up each time the business method was called. However, I have seen
several posts from the EJB spec writers dismissing coding conventions in the
EJB spec as not literal suggestions of coding practice, but rather, easy
examples that demonstrate the "bigger picture".
As a matter of fact, I think some enterprising developer's SmartProxy
structure is based on this kind of caching of context and Home interfaces.
;-)
>> Both creating InitialContexts and Home-object lookups are being
>> made fairly cheap. Check out chapter 5 in the J2EE 1.2 spec.
I think this would vary on the implementation beneath the JNDI process.
Regardless, there shouldn't be any reason why not to wrapper every Home
and/or Remote interface with a reusable class that traps RemoteException
errors. This wrapper could perform a relookup of the Home, or even reaquire
the context, prior to subsequent retries of the original request.
jim
Hey
George Richards wrote:
> I'm creating a JSP -> EJB application. I considering using a session
> scope bean at the JSP level to cache the home interfaces my JSP pages
> will use. The cache will be lazily filled, the interface will only be
> looked up once the first request for it is made.
>
> Does this seem like a good idea?
>
> Any comments on caching home interfaces?
>
> Is there a problem with multiple pages sharing the same home interface?
>
> What is the cost of the JNDI lookup that returns the home interface?
===========================================================================
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".