[ https://issues.apache.org/jira/browse/IGNITE-2158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15057911#comment-15057911 ]
Yakov Zhdanov commented on IGNITE-2158: --------------------------------------- It is so that CacheDummyStoreExample, CacheJdbcStoreExample and CacheSpringStoreExample cannot work in distributed cluster since each node starts its own store and this prevents us from demonstrating clear() and withSkipStore(). Examples should be fixed to use single store instance or removed from project. I tried modifying org.apache.ignite.examples.datagrid.store.dummy.CacheDummyStoreExample#executeTransaction in the following manner. {code} private static void executeTransaction(IgniteCache<Long, Person> cache) { try (Transaction tx = Ignition.ignite().transactions().txStart()) { Person val = cache.get(id); System.out.println("Read value: " + val); val = cache.getAndPut(id, new Person(id, "Isaac", "Newton")); System.out.println("Overwrote old value: " + val); val = cache.get(id); System.out.println("Read value: " + val); tx.commit(); } System.out.println("Read value after commit: " + cache.get(id)); // Clear entry from memory, but keep it in store. cache.clear(id); // Operations on this cache will not affect store. IgniteCache<Long, Person> cacheSkipStore = cache.withSkipStore(); System.out.println("Read value skipping store (expecting null): " + cacheSkipStore.get(id)); System.out.println("Read value with store lookup (expecting NOT null): " + cache.get(id)); // Expecting not null, since entry should be in memory since last call. System.out.println("Read value skipping store (expecting NOT null): " + cacheSkipStore.get(id)); } {code} Then I started 3 remote nodes with {{ExampleNodeStartup}} And output was: {code} >>> Cache store example started. >>> Store loadCache for entry count: 100000 >>> Loaded 100000 keys with backups in 1639ms. Read value: null Overwrote old value: null Read value: Person [id=8653755053717283485, orgId=null, lastName=Newton, firstName=Isaac, salary=0.0, resume=null] >>> Store put [key=8653755053717283485, val=Person [id=8653755053717283485, >>> orgId=null, lastName=Newton, firstName=Isaac, salary=0.0, resume=null], >>> xid=3d32135a151-03acc8a8-0000-0006-0000-0151a530c95b] Read value after commit: Person [id=8653755053717283485, orgId=null, lastName=Newton, firstName=Isaac, salary=0.0, resume=null] Read value skipping store (expecting null): null Read value with store lookup (expecting NOT null): null Read value skipping store (expecting NOT null): null {code} > Null values in output of CacheDummyStoreExample, CacheJdbcStoreExample and > CacheSpringStoreExample > -------------------------------------------------------------------------------------------------- > > Key: IGNITE-2158 > URL: https://issues.apache.org/jira/browse/IGNITE-2158 > Project: Ignite > Issue Type: Bug > Components: general > Affects Versions: 1.5 > Environment: OS X 10.10.2 > jdk 1.7 > Reporter: Ilya Suntsov > Fix For: 1.5 > > > In output of the following examples there are fields that have 'null' or zero > values (salary, orgId, resume ): > 1.CacheDummyStoreExample > {noformat} > [16:48:47] Ignite node started OK (id=64a079ad) > [16:48:47] Topology snapshot [ver=9, servers=3, clients=0, CPUs=8, heap=8.0GB] > >>> Cache store example started. > >>> Store loadCache for entry count: 100000 > >>> Loaded 100000 keys with backups in 971ms. > Read value: null > Overwrote old value: null > Read value: Person [id=7754401276845136764, orgId=null, lastName=Newton, > firstName=Isaac, salary=0.0, resume=null] > >>> Store put [key=7754401276845136764, val=Person [id=7754401276845136764, > >>> orgId=null, lastName=Newton, firstName=Isaac, salary=0.0, resume=null], > >>> xid=ab2b0c0a151-03aba62c-0000-0009-0000-0151a0c0307a] > Read value after commit: Person [id=7754401276845136764, orgId=null, > lastName=Newton, firstName=Isaac, salary=0.0, resume=null] > [16:48:48] Ignite node stopped OK [uptime=00:00:01:38] > {noformat} > 2. CacheJdbcStoreExample > {noformat} > [16:49:36] Ignite node started OK (id=f662db78) > [16:49:36] Topology snapshot [ver=11, servers=3, clients=0, CPUs=8, > heap=8.0GB] > >>> Cache store example started. > >>> Loaded 0 values into cache. > >>> Loaded 1 keys with backups in 26ms. > >>> Store load [key=8980561285181288706] > Read value: null > Overwrote old value: null > Read value: Person [id=8980561285181288706, orgId=null, lastName=Newton, > firstName=Isaac, salary=0.0, resume=null] > >>> Store write [key=8980561285181288706, val=Person [id=8980561285181288706, > >>> orgId=null, lastName=Newton, firstName=Isaac, salary=0.0, resume=null]] > Read value after commit: Person [id=8980561285181288706, orgId=null, > lastName=Newton, firstName=Isaac, salary=0.0, resume=null] > [16:49:36] Ignite node stopped OK [uptime=00:00:00:182] > {noformat} > 3. CacheSpringStoreExample > {noformat} > [16:50:16] Ignite node started OK (id=670dd40a) > [16:50:16] Topology snapshot [ver=13, servers=3, clients=0, CPUs=8, > heap=8.0GB] > >>> Cache store example started. > >>> Loaded 0 values into cache. > >>> Loaded 0 keys with backups in 33ms. > Read value: null > Overwrote old value: null > Read value: Person [id=8312945083421167351, orgId=null, lastName=Newton, > firstName=Isaac, salary=0.0, resume=null] > >>> Store write [key=8312945083421167351, val=Person [id=8312945083421167351, > >>> orgId=null, lastName=Newton, firstName=Isaac, salary=0.0, resume=null]] > Read value after commit: Person [id=8312945083421167351, orgId=null, > lastName=Newton, firstName=Isaac, salary=0.0, resume=null] > [16:50:16] Ignite node stopped OK [uptime=00:00:00:469] > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)