>     Regarding caching :
>         Creating an initial context might take some time and
> when I coded my
> API objects, I decided to cache the initial context. This
> way, I didn't have
> to recreate it each time, thus saving some cycles. But is
> this really a good
> idea ? Like suppose I have 2 containers, C1 and C2. I create
> an initial
> context and access a bean on C1. If a few minutes later C1
> fails, will my
> bean calls still work ? I mean, is my InitialContext bound to
> a specific EJB
> Container or is it dynamic ? So is it a good idea to cache the initial
> context (so it is used by all my API objects) ?
>
>         If I should not cache the initial context, would it
> be a better idea
> to cache the home interface to my beans ?
>

This is all highly app server dependent. One thing to do is to create a
utility class for fetching naming contexts and home interfaces. Implement it
straightforwardly at first, then add caching as you profile your app and
learn the nuances of your server.

This class might also be the place for setting lookup parameters (server
URL, etc.).

- Avi
--
This signature intentionally left blank.

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