Hi Val, I created a short test. I'm using Ignite 1.4
> public class Test {
> public static void main (String[] args) {
> Ignite ignite = Ignition.start();
> CacheConfiguration
> <
> Integer, String
> >
> cacheConfiguration = new CacheConfiguration<>("mycache");
> IgniteReflectionFactory
> <TestCacheStore>
> factory = new IgniteReflectionFactory<>(TestCacheStore.class, true);
> cacheConfiguration.setCacheStoreFactory(factory);
>
> cacheConfiguration.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
> cacheConfiguration.setReadThrough(true);
> cacheConfiguration.setWriteThrough(true);
> cacheConfiguration.setIndexedTypes(Integer.class, String.class);
>
> IgniteCache
> <
> Integer, String
> >
> cache = ignite.getOrCreateCache(cacheConfiguration);
>
> cache.invoke(1, (entry, arguments) -> {
> System.out.println("x " + entry.getValue());
> return null;
> });
>
> System.out.println("y " + cache.get(1));
>
> cache.invoke(1, (entry, arguments) -> {
> System.out.println("z " + entry.getValue());
> return null;
> });
> }
>
> public static class TestCacheStore extends CacheStoreAdapter
> <
> Integer, String
> >
> {
> @Override
> public String load(Integer key) throws CacheLoaderException {
> return "hi";
> }
>
> @Override
> public void write(Cache.Entry<? extends Integer, ? extends String>
> entry) throws CacheWriterException {
>
> }
>
> @Override
> public void delete(Object key) throws CacheWriterException {
>
> }
> }
> }
Output:
x null
x null
x null
y hi
z hi
z hi
z hi
--
View this message in context:
http://apache-ignite-users.70518.x6.nabble.com/Cache-read-through-when-invoking-EntryProcessor-tp1557p1559.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.