Vinay,

As a first step I would recommend to refer to cache store examples provided
in Ignite: JDBC-based [1], Spring-based [2] and Hibernate-based [3]. They
all are pretty similar and demonstrate similar functionality, but
implemented using different tools. Note that corresponding session listeners
are already implemented and provided out of the box.
BTW, I think JPA/JTA-based implementation could be also useful, I create a
ticket for this [4].

In general, store session scope depends on cache atomicity mode. In ATOMIC
cache a new session is always created for each operation, while in
TRANSACTIONAL cache it spawns all operations in a single transaction. The
latter allows you to commit/rollback DB transaction along with the cache
transaction and therefore maintain transactional consistency between cache
and the DB.

As for configuration, you will have to deploy cache reader/writer
implementation classes on all nodes. Note that you provide Factory in
configuration instead of reader/writer instance, so it created only on the
node where it will be used. This allows to make reader/writer
non-serializable.

[1]
https://github.com/apache/ignite/tree/master/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc
[2]
https://github.com/apache/ignite/tree/master/examples/src/main/java/org/apache/ignite/examples/datagrid/store/spring
[3]
https://github.com/apache/ignite/tree/master/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate
[4] https://issues.apache.org/jira/browse/IGNITE-2345

Let us know if you have more questions.

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/SoreSessionListener-cacheLoaderFactory-cacheWriterFactory-implementation-examples-tp2462p2477.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Reply via email to