Search code examples
javacachingoracle-coherence

Oracle coherence caching, specifying expiry timeout while adding the object into cache


I am using oracle coherence caching.

For configuring expiry, there is a parameter called 'expiry-delay' to configure the expiry in xml file.

I would like to know if it is possible to pass the expiry duration while adding the object into the cache.

Appreciate any help on this.


Solution

  • try to set TTL value when you put new item to the cache

    Object put(Object oKey,
           Object oValue,
           long cMillis)
    

    CacheMap JavaDoc