Discussions

EJB programming & troubleshooting: caching (long living) ejb references

  1. caching (long living) ejb references (1 messages)

    hello there,

    we are caching ejb-references (not the homes, the ejb-ref directly!) on some places within our j2ee-application (e.g. on the web tier but also as non-static members of SLSB's to reference with each other).

    as we have been using jonas 3.3.6 over the last months this worked fine, now after upgrading to 4.2.3 we suddenly get JNDI/lookup errors after keeping the server up for a longer time (e.g. 24 hours or longer).

    So I assume that possible the caching of long-living EJB references could be a problem. Unfortunately I did not find any information about that in the specs or j2ee tutorial.

    has anyone of you further information/experiences/tips at that topic???

    any help appreciated,

    hans
  2. Hans -
    I assume you mean the handles? You should always the the home handle or the ejb handle and instantiate the bean via the handle. (It forces a lookup each time but is very save as you don't reference a specific instance.)

    Hope this helps, let me know you have more questions -
    Jon