sorry, I pasted the wrong configuration file, I was checking on whether the
program can write through the database if writeBehindEnabled is turned off.

It should be like this:

<beans xmlns="http://www.springframework.org/schema/beans";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xmlns:util="http://www.springframework.org/schema/util";
       xsi:schemaLocation="
        http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd";>
    <description>Main Spring file for ignite configuration.</description>

    <bean
class="org.springframework.jdbc.datasource.DriverManagerDataSource"
id="dataSource">
            <property name="driverClassName"
value="com.mysql.jdbc.Driver"></property>
            <property name="url"
value="jdbc:mysql://localhost:3306/learnignite"></property>
            <property name="username" value="root"></property>
            <property name="password" value=""></property>
        </bean>
        <bean class="org.apache.ignite.configuration.IgniteConfiguration"
id="ignite.cfg">
            <property name="cacheConfiguration">
                <list>
                    <bean
class="org.apache.ignite.configuration.CacheConfiguration">
                        <property name="name" 
value="transactionCache"></property>
                                        
                        
                        <property name="readThrough" value="true"></property>
                        <property name="writeThrough" value="true"></property>
                        *it should be like this*
                        <property name="writeBehindEnabled"
value="true"></property>
                        
                        <property name="queryEntities">
                            <list>
                                <bean 
class="org.apache.ignite.cache.QueryEntity">
                                    <property name="keyType"
value="java.lang.Long"></property>
                                    <property name="valueType"
value="ignite.myexamples.model.Store"></property>
                                    <property name="fields">
                                        <map>
                                                                                
<entry key="idNumber" value="java.lang.Integer"></entry>
                                            <entry key="amount"
value="java.lang.Integer"></entry>
                                        </map>
                                    </property>
                                </bean>
                            </list>
                        </property>
                        
                                
                        <property name="cacheStoreFactory">
                            <bean 
class="javax.cache.configuration.FactoryBuilder"
factory-method="factoryOf">
                                <constructor-arg
value="myexamples.store.TransactionStore"></constructor-arg>
                            </bean>
                        </property>
                    </bean>
                </list>
            </property>
            
            <property name="discoverySpi">
                    <bean 
class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
                      <property name="ipFinder">
                        <bean
class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
                          <property name="multicastGroup" 
value="228.10.10.157"/>
                           
                          
                          <property name="addresses">
                            <list>
                              <value>localhost/127.0.0.1:3306</value>
                            </list>
                          </property>
                        </bean>
                      </property>
                    </bean>
                  </property>
    </bean>
</beans>

And it's still not writing the data to the persistent store even after I
waited for 5 seconds. Any suggestion?

--Ricky



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/How-to-do-write-behind-caching-tp12138p12278.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Reply via email to