Hi all !

    I have some questions regarding caching and optimisation, and some code
style...
    Here is the description, it is a very standard client-ejb program. We
have the JSPs and servlets which are accessed by the clients to perform
queries. The queries are passed to our API, which in turn connect to the EJB
server where all the business logic is performed.

    Which means that it is in my API objects that I access the beans. When I
first started the project, I didn't have a lot of knowledge on EJBs but now
I am going back to that code for some cleanups and some questions popped to
me.

    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 ?

    So simply put, should I cache the context, the home interface or
anything or just let the system do its magical work all by itself ?

    Maxime.

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