I have an application that uses an Oracle Coherence cache backed by a database. Each item that is added in the cache must have a custom expiry delay computed from its content.
Is it possible to set a new expiry delay for the entries loaded in the cache from the database by a read through operation?
I tried setting a new expiry delay in the load method of the BinaryEntryStore, but it is ignored and the default expiry of the corresponding cache is used instead. Also I tried using a MapTrigger, but the entries added in the cache by a read through operation are not intercepted by the MapTrigger.
What we do (not sure if it proper way, but it worked for us) is extend the LocalCache and override the put method.
public Object put(
long newexpiry = xxxxx;
return super.put(oKey, oValue, newexpiry);