A set of methods defined for the
When the object cache is full and a new object is to be copied into cache, one or more objects must be removed from the cache to make enough room. By default, the least-recently referenced object is selected for removal from cache.
The methods in the following subsections enable you to adjust this policy for selected objects in cache, by using a concept of lives. By default, an object has a single life. If it is selected to be removed from cache because it is the object that was least-recently accessed, it is removed because it has used its one life.
The
You can therefore use the
You can also use these methods to lower the number of lives for an object in cache; in particular, if you set the number of lives to zero (0), the object is removed from cache immediately. This suits objects that are accessed once only.
After being accessed, you can use the
The number of lives an object has applies only while the object is in cache. When an object is first loaded into cache, it is always assigned one life. Lives are not recorded for objects that are not in the cache.
Although String Large Objects (slobs) and Binary Large Objects (blobs) are removed when the cache priority of an object is set to zero (0), exclusive collections are not removed and you must remove these individually, as shown in the following examples.
// remove obj1 from cache as well as its slobs and blobs, but not its // exclusive collections process.setObjectCachePriority(obj1, 0);
// remove the exclusive collection obj2.allObj3s from cache and any of // its collection blocks process.setObjectCachePriority(obj2.allObj3s, 0);
A process must use its own Process instance as the method receiver. Using any other Process instance raises exception 1265 (
For details, see the following subsections.