You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Saifullah Zahid <sa...@gmail.com> on 2017/03/12 19:22:43 UTC

Ignite.NET ReadThrough?

Hi,
I am using Ignite.NET and following code is used to get list of details
from Cache

List<ProductDetail> result = new List<ProductDetail>();
var query = m_productDetailStore.Query(new ScanQuery<int,
ProductDetail>(new ProductDetailFilter(nProductHeaderID)));
foreach (var cacheEntry in query)
{
    result.Add(cacheEntry.Value);
}
return result;

Above code does not returns values if Database gets updated (looks like
ReadThrough not working.)
I am using SQL Server as Persistence store
I have implemented ICacheStore interface.
How I can updated my Cache if database gets updated is there any other way
to achieve this?
If anyone have any idea?

Thanks,

Re: Ignite.NET ReadThrough?

Posted by vkulichenko <va...@gmail.com>.
Hi,

First of all, it sounds like you misunderstood the read-though. It is used
ONLY if entry does not exist in cache yet. If you read a value that is
already in cache, cache will never go the database, even if the value was
updated there, because cache simply doesn't know about it.

You should avoid updating database directly, it's much better to do updates
through Ignite API with write-though. This will guarantee consistency and
will fix your problem. In case you update database directly, you will have
to reload corresponding updates manually (you can use
IgniteCache.loadAll(...) method for that).

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-NET-ReadThrough-tp11151p11155.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.