ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vasiliy Sisko <vsi...@gridgain.com>
Subject Re: CacheJdbcPojoStoreExampleFactory for Maria DB
Date Mon, 05 Sep 2016 07:48:28 GMT
Hello @seyeony. 

The idiomatic ways of data source usage with CacheJdbcPojoStoreFactory are
specification of data source bean name or implementation of data source
factory class.

NOTE: When you implement data source bean factory class it should be
available in classpath for every node. F.e.:

    public class MyDataSourceFactory implements Factory<DataSource> {
        @Override public DataSource create() {
            JdbcDataSource dataSource = new JdbcDataSource();
            return dataSource;
CacheJdbcPojoStoreFactory storeFactoryJdbcPojo = new

storeFactoryJdbcPojo.setDataSourceFactory(new MyDataSourceFactory());
NOTE: When you specify data source bean name bean with that name should be
described in spring configuration for every node. F.e:
    <bean id="h2Jdbc" class="org.h2.jdbcx.JdbcDataSource">
        <property name="URL" value="${h2Jdbc.jdbc.url}"/>
        <property name="user" value="${h2Jdbc.jdbc.username}"/>
        <property name="password" value="${h2Jdbc.jdbc.password}"/>

    <property name=&quot;cacheStoreFactory
            <property name="dataSourceBean" value="h2Jdbc"/>

View this message in context: http://apache-ignite-users.70518.x6.nabble.com/CacheJdbcPojoStoreExampleFactory-for-Maria-DB-tp7479p7528.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

View raw message