Everybody says to cache EJBHome references, to avoid JNDI lookup overhead. But what about the Remote Interface?
- Posted by: ivan di maro
- Posted on: March 03 2005 12:05 EST
Why not to Cache it too? Someone can give me an explaination?
Deeply: is there any difference with the different kinds of EJBs? (I'm using just one Stateless...)
Thank's and bye
You should not cache the EJBObject. Because, It's just a reference and it's not necessarily guaranteed to remain "connected" to the EJB container or may have collected by GC.
On other side, EJBHome, which is already bound with JNDI and can't be invalidate and therefore are best candidate for cache.
I don't know but it's depend on your application design and requirement but Handles are more better then EJBHome in terms of caching.
Hope this will help :)
I Thank you for your answer. In the time I had found a very interesting thread here
Take a look if you want.
With that information I cached the EJBHome too (in particular the EJB Handle). I hope it will work fine...