ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzamy_5.4.0.1/50/program/jndicchb.htm

32 lines
2.7 KiB
HTML
Raw Permalink Normal View History

2024-04-02 14:02:31 +00:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<LINK rel="stylesheet" type="text/css" href="../../../rzahg/ic.css">
<title>JNDI cache behavior</title>
</head>
<BODY>
<!-- Java sync-link -->
<SCRIPT LANGUAGE="Javascript" SRC="../../../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
<h6><a name="jndicchb"></a>JNDI cache behavior</h6>
<p>A cache is associated with an initial context when a javax.naming.InitialContext object is instantiated with the java.naming.factory.initial property set to com.ibm.websphere.naming.WsnInitialContextFactory.</p>
<p>WsnInitialContextFactory searches the environment properties for a cache name, defaulting to the provider URL. If no provider URL is defined, the cache name iiop:/// is used. All instances of InitialContext that use a cache of a given name share the same cache instance.</p>
<p>After an association between an InitialContext instance and cache is established, the association does not change. A javax.naming.Context object returned from a lookup operation will inherit the cache association of the Context object on which the lookup was performed. Changing cache property values with the Context.addToEnvironment() or Context.removeFromEnvironment() method does not affect cache behavior. Properties affecting a given cache instance, however, may be changed with each InitialContext instantiation.</p>
<p>A cache is restricted to a process and does not persist beyond the life of the process. A cached object is returned from lookup operations until either the <a href="jndicchp.htm#maxcachelife">maximum cache life</a> for the cache is reached, or the <a href="jndicchp.htm#maxentrylife">maximum entry life</a> for the object's cache entry is reached.</p>
<p>After the object's cache reaches its maximum life or the object reaches its maximum entry life, a lookup on the object causes the cache entry for the object to be refreshed. If a bind or rebind operation is performed on an object, the change is not reflected in any caches other than the one associated with the context from which the bind or rebind operation was issued. This &quot;stale data&quot; scenario is most likely to happen when multiple processes are involved because different processes do not share the same cache, and Context objects in all threads in a process typically share the same cache instance for a given name service provider.</p>
<p>Cached objects are typically relatively static entities, and objects becoming stale should not be a problem. However, you can set timeout values on cache entries or on a cache to periodically refresh cache contents.</p>
</body>
</html>