EJB programming & troubleshooting: y not use JNDI as cache?

  1. y not use JNDI as cache? (2 messages)

    Hi , (1) I have a small clarification in using JNDI as cache. will there be any perfomance issue in using JNDI as cache and if yes tell me y?.If no then y seperate cache engines are being used. And more over although we use cache EJB's still we make use of JNDI to refer the cache EJB. (2) will there be any perfomance issue in frequently lookingup JNDI? Thanks, Bala.J
  2. Hi! There are issues that need to be considered when caching data. For example, if it is still valid... JNDI can be used as a cache, but take care what kind of data are you storing in it. Keep in mind that JNDI's primary goal is the availability of services in a relatively independent way, without knowing anything about what it does. As for performance, that will depend on where your JNDI data is phisically stored. If you're running on the same machine where your JNDI repository is, it might be fast enough for your needs. But you may not have the control to guarantee this infra-structure will always be this way... Hope I could help
  3. In my opinion using JNDI as cache is just like using your car for heavy transport. Yah both will move your stuff to new place but car is not meant for that purpose. Similiarly JNDI is targetted for saving the directory info with its attributes. Its main feature is data stored in directory/hierarchical structure and capability to search based on attributes (no upper limit to no of attributes .. infinite in numbers). While Cache is a piece of component which will ensure reliable storage, synch up and quick searches based on finite attributes of data. There is no reason for anyone to use JNDI for this purpose. You should instead store the reference to cache in JNDI but not whole cache. Let me know what you thinik about my views!!! shrini