Hi,
do I have to write any method lor cache.loadCache or it should be used as
is?

Is using loadCache an alternative to using the readThrough?
I tried to use both options and can't see any attempt during starting my
cache to even try loading the data from my SQL Server database. ReadThrough
doesn't seem to work at all. Though the write-behind works absolutely fine.

Unless I am missing any extra configuration. I expected that it will use my
XML cache mappings.

My setup is below:

                <property name="cacheConfiguration">
                        <list>
                                <bean 
class="org.apache.ignite.configuration.CacheConfiguration">
                                        <property name="name" value="myCache"/>
                                        <property name="atomicityMode" 
value="TRANSACTIONAL"/>

                                        <property name="writeThrough" 
value="true"/>
                                        <property name="readThrough" 
value="true"/>
                                        <property name="writeBehindEnabled" 
value="true"/>
                                        <property name="cacheStoreFactory">
                                        <bean
class="org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory">
                                                <property name="dataSourceBean" 
value="IgniteDataSource" />
                                                <property name="dialect">
                                                        <bean
class="org.apache.ignite.cache.store.jdbc.dialect.SQLServerDialect">
                                                        </bean>
                                                </property>
(...)
                                        </bean>
                                        </property>
                                </bean>

My Java code for starting cache:

        private static IgniteCache<myKey, myValue> myCache = null;

        public void start() throws StorageException {
                Ignite ignite = myCacheFactory.start();
                if (myCache == null) {
                        synchronized(lock) {
                                if (myCache == null) {
                                        myCache = 
ignite.getOrCreateCache("myCache");
                                        myCache.loadCache(null);
                                }
                        }
                }

How to trigger Ignite to actually try loading the data from the store
(CacheJdbcPojoStoreFactory using SQL Server JDBC driver).

Thanks
Michal




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

Reply via email to