When I use bean org.apache.ignite.configuration.CacheConfiguration, at start
of the server I receive an error "CacheConfiguration.
org.apache.ignite.IgniteException: Default Ignite instance has already been
started"


        <bean id="CacheTestDataSource"
class="org.postgresql.ds.PGConnectionPoolDataSource">
                <property name="serverName" value="localhost"/>
                <property name="databaseName" value="Ignite"/>
                <property name="portNumber" value="5432"/>
                <property name="user" value="postgres"/>
                <property name="password" value="postgres"/>
        </bean>


        <bean class="org.apache.ignite.configuration.IgniteConfiguration">      
                <property name="cacheConfiguration">
                        <list>

                                <bean 
class="org.apache.ignite.configuration.CacheConfiguration">
                                        <property name="name" 
value="CategoryCache"/>
                                        <property name="cacheMode" 
value="PARTITIONED"/>
                                        <property name="atomicityMode" 
value="ATOMIC"/>

                                        
                                        <property name="cacheStoreFactory">
                                                <bean
class="org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory">
                                                        <property 
name="dataSourceBean" value="CacheTestDataSource"/>
                                                        <property 
name="dialect">
                                                                <bean
class="org.apache.ignite.cache.store.jdbc.dialect.BasicJdbcDialect"/>
                                                        </property>             
                                

                                                        
                                                        <property name="types">
                                                                <list>
                                                                        <bean 
class="org.apache.ignite.cache.store.jdbc.JdbcType">
                                                                                
<property name="cacheName" value="CategoryCache"/>
                                                                                
<property name="keyType" value="java.lang.Integer"/>
                                                                                
<property name="valueType"
value="techoserv.ignite.cache.TestCache"/>
                                                                                
<property name="databaseSchema" value="Ignite"/>
                                                                                
<property name="databaseTable" value="TestCache"/>
                                                                                
<property name="keyFields">
                                                                                
        <list>
                                                                                
                <bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
                                                                                
                        <constructor-arg>
                                                                                
                                <util:constant 
static-field="java.sql.Types.INTEGER"/>
                                                                                
                        </constructor-arg>
                                                                                
                        <constructor-arg value="id"/>
                                                                                
                        <constructor-arg value="java.lang.Integer"/>
                                                                                
                        <constructor-arg value="id"/>
                                                                                
                </bean>
                                                                                
        </list>
                                                                                
</property>
                                                                                
<property name="valueFields">
                                                                                
        <list>
                                                                                
                <bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
                                                                                
                        <constructor-arg>
                                                                                
                                <util:constant 
static-field="java.sql.Types.VARCHAR"/>
                                                                                
                        </constructor-arg>
                                                                                
                        <constructor-arg value="Category"/>
                                                                                
                        <constructor-arg value="java.lang.String"/>
                                                                                
                        <constructor-arg value="Category"/>
                                                                                
                </bean>
                                                                                
        </list>
                                                                                
</property>
                                                                        </bean> 
                                                                                
                        
                                                                </list>
                                                        </property>

                                                </bean>
                                        </property>

                                        <property name="readThrough" 
value="true"/>
                                        <property name="writeThrough" 
value="true"/>

                                        <property name="queryEntities">
                                                <list>
                                                        <bean 
class="org.apache.ignite.cache.QueryEntity">
                                                                <property 
name="keyType" value="java.lang.Integer"/>
                                                                <property 
name="valueType"
value="techoserv.ignite.cache.TestCache"/>
                                                                <property 
name="keyFieldName" value="id"/>
                                                                <property 
name="keyFields">
                                                                        <list>
                                                                                
<value>id</value>
                                                                        </list>
                                                                </property>     
                                                
                                                                <property 
name="fields">
                                                                        <map>
                                                                                
<entry key="category" value="java.lang.String"/>
                                                                        </map>
                                                                </property>
                                                        </bean>
                                                </list>
                                        </property>                             
        

                                </bean>                         
                        </list>
                </property>
        </bean>



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

Reply via email to