Add H2 datasource bean in example-default.xml

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Add H2 datasource bean in example-default.xml

Alexey Kuznetsov-2
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
Reply | Threaded
Open this post in threaded view
|

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

dsetrakyan
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 <[hidden email]>
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
>