문제

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.

도움이 되었습니까?

해결책

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

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

CacheMap JavaDoc

다른 팁

You can invoke the method put(Object oKey, Object oValue, long cMillis) on the NamedCache you hold. When calling this method, your entry will expire exactly after cMillis it is committed to the cache (and committed to the DB if you have persistency). By this way, Coherence will ignore the default value set in the scheme definition. If you wanna use anyway the default value, you can use CacheMap.EXPIRY_DEFAULT as value.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top