You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by Alexey Kuznetsov <ak...@gridgain.com> on 2015/12/02 17:01:58 UTC

Add H2 datasource bean in example-default.xml

Guys,

While working on [https://issues.apache.org/jira/browse/IGNITE-2041]
I found that we use deprecated code in JDBC cache store examples.

Correct way to configure JDBC cache store is to
use CacheJdbcPojoStoreFactory + specify dataSource bean name.

So I would like to add following bean into example-default.xml:

<!-- Datasource for sample in-memory H2 database. -->
<bean id="h2-example-db" class="org.h2.jdbcx.JdbcDataSource">
 <property name="URL" value="jdbc:h2:tcp://localhost/mem:ExampleDb" />
 <property name="user" value="sa" />
</bean>

This will allow to run multi nodes examples when one node started from IDE,
and another from ignite.sh

Any objections?

-- 
Alexey Kuznetsov
GridGain Systems
www.gridgain.com

Re: Add H2 datasource bean in example-default.xml

Posted by Dmitriy Setrakyan <ds...@apache.org>.
Alexey,

As agreed in the chatroom, let’s fix the example by moving the data source
factory from anonymous class to a static class, which will allow the error
message on the server side specify the full class name of the missing class.

Seems like this is the best we can do for this problem.

D.

On Wed, Dec 2, 2015 at 8:01 AM, Alexey Kuznetsov <ak...@gridgain.com>
wrote:

> Guys,
>
> While working on [https://issues.apache.org/jira/browse/IGNITE-2041]
> I found that we use deprecated code in JDBC cache store examples.
>
> Correct way to configure JDBC cache store is to
> use CacheJdbcPojoStoreFactory + specify dataSource bean name.
>
> So I would like to add following bean into example-default.xml:
>
> <!-- Datasource for sample in-memory H2 database. -->
> <bean id="h2-example-db" class="org.h2.jdbcx.JdbcDataSource">
>  <property name="URL" value="jdbc:h2:tcp://localhost/mem:ExampleDb" />
>  <property name="user" value="sa" />
> </bean>
>
> This will allow to run multi nodes examples when one node started from IDE,
> and another from ignite.sh
>
> Any objections?
>
> --
> Alexey Kuznetsov
> GridGain Systems
> www.gridgain.com
>