Raminaa, Most of the time, people use a singleton per JVM or resources managed by the server (like datasources.) If you have a true requirement for an object across the cluster, you are correct that you would need the JNDI.
Thank you Jeanne, Indeed what i want to share in all cluster is a cache manager. By what i read in web pages, if we want to share someting between all nodes in cluster we should put it into the JNDI (the JNDI allways is replicated between all server instance). Is the above statement corrent?
If it is corrent and we should put the cache manager into the JNDI, then we should initiate the cache manager ? should we use a servlet that initialize when application start to initialize the cache manager, if i do this then all instance will do the same and we will have more than one cache manager?
Raminaa, I haven't heard of people commonly using the JNDI as a cache. Note that WebLogic recommends against this practice. So you will need to read your application server documentation to make sure the replication works as you would require.
Assuming your server provides unique objects: A servlet is fine to put an object in the JNDI. You can check whether the object is already bound to avoid multiple copies.