Hi
I want to make sure I undestand the jndi caching of WAS. I try the below example:
I have a standalone application accessing the objects in remote WAS 3.5 using jndi, I write the following code:
================================================
env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.ejs.ns.jndi.CNInitialContextFactory");
env.put(Context.PROVIDER_URL, "iiop://remotehost");
Context ctx = new InitialContext(env);
ctx.lookup("myObject");
=================================================
In this case, a cached copy of myOject will be stored in the local machine. If I lookup myObject again, then this cached copy will be returned instead of actually lookup. Right? If I want to get a remote copy, can I use the following code to do so?
================================================
env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.ejs.ns.jndi.CNInitialContextFactory");
env.put(Context.PROVIDER_URL, "iiop://remotehost");
env.put("com.ibm.websphere.naming.jndicache.cacheobject","cleared");
Context ctx = new InitialContext(env);
ctx.lookup("myObject");
=================================================
Please correct me if I am wrong.
Thank you
Leo