Reputation: 20623
I have created a cache in the web sphere which will be shared by multiple applications and i wanted to make one entry in the created cache to not to expire. How can i make it ?
Thanks and Regards,
Sunny.
Upvotes: 4
Views: 3235
Reputation: 27614
Are you deriving/using WebSpheres dyna-cache (DistributedObjectCache)? How are you creating your cache instance?
The DistributedObjectCache
(through it's DistributedMap
parent) defines a "put" method overload that accepts a TTL for the individual cache entry. If you want to set the TTL for the entire cache, there is conversely a setTimeToLive(int)
method in DistributedMap
Worth noting is that the TTL is not available as a configuration option in the cacheinstances.properties (or the admin console Resources/Cache Instances/Object cache instances), it has to be set programatically using setTimeToLive()
Upvotes: 3