Hey

James Cook wrote:
> >> 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".

True, but still...

> 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.
> ;-)

Ouch 8-)

> >> 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.

Aha! A promo for SmartProxies.. 8-) Actually, with the new RMI semantics
of 1.2.2, SmartProxies is hotter than ever since it doesn't require that
funky interface split workaround it used to. Completely transparent to
use 'em.

But an even hotter technique is to use Dynamic Proxies in JDK1.3. Once
EJB servers are updated to support it so that one can use them they will
be the preferred way of doing customized smart stubs IMHO. Very cool
indeed.

/Rickard

ps. Should I have <vendor>'ed that? I mean, it's a free download... :-)
ds.

--
Rickard �berg

@home: +46 13 177937
Email: [EMAIL PROTECTED]
Homepage: http://www-und.ida.liu.se/~ricob684

===========================================================================
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