You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by luqmanahmad <lu...@gmail.com> on 2018/08/28 21:54:19 UTC

keep old cache value than new value

Hi,

Is there any feature in ignite through which I can decide whether to keep
the old value or new value in a cache? We have few cases when the update
comes from the persistence store we want do not want to update the cache
value and want to keep the old one.

Thanks,
Luqman



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: keep old cache value than new value

Posted by luqmanahmad <lu...@gmail.com>.
Nice, that might work - thanks Denis



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: keep old cache value than new value

Posted by Denis Magda <dm...@apache.org>.
Luqman,

You can try EntryProcessor API - invoke the processor passing an entry key
and a new value as parameters. When the processor is executed on the
cluster side, Ignite will give you the old value and the new one passed by
you. Compare them and decide which to store in the cache.

CacheEntryProcessorExample demonstrates the basics of EntryProcessor APIs.

--
Denis

On Wed, Aug 29, 2018 at 4:08 PM luqmanahmad <lu...@gmail.com> wrote:

> Thanks Denis for getting back to me much appreciated.
>
> The use case we have is we have millions of data points which is updated by
> the other teams in separate databases. Whenever this happens we receive a
> message upon update and it triggers the load cache process in ignite.
>
> Until now we did not have any problem but now we have certain requirements
> in which we have to do some calculation based on some fields from cache
> value and decide whether to update the value inside the cache or not. Maybe
> I am not thinking straight over here, but is there something I am missing
> from ignite which can be used to overcome this problem.
>
> Thanks,
> Luqman
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: keep old cache value than new value

Posted by luqmanahmad <lu...@gmail.com>.
Thanks Denis for getting back to me much appreciated.

The use case we have is we have millions of data points which is updated by
the other teams in separate databases. Whenever this happens we receive a
message upon update and it triggers the load cache process in ignite. 

Until now we did not have any problem but now we have certain requirements
in which we have to do some calculation based on some fields from cache
value and decide whether to update the value inside the cache or not. Maybe
I am not thinking straight over here, but is there something I am missing
from ignite which can be used to overcome this problem.

Thanks,
Luqman



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: keep old cache value than new value

Posted by Denis Mekhanikov <dm...@gmail.com>.
If you use a cache store, and change values in the underlying database,
then they won't be propagated to Ignite, and old values will be used.
There is no mechanism, that can notify the cache about updates on the
3rd-party DB.
But if you didn't have this value in the cache, and read-through
<https://apacheignite.readme.io/docs/3rd-party-store#section-read-through-and-write-through>
is enabled, then it will be loaded on the next access.

Denis


ср, 29 авг. 2018 г. в 12:05, luqmanahmad <lu...@gmail.com>:

> anyone from anyone would be highly appreciated
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: keep old cache value than new value

Posted by luqmanahmad <lu...@gmail.com>.
anyone from anyone would be highly appreciated 



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/