You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Kobe <rk...@mailcity.com> on 2016/03/10 21:16:40 UTC
Simple example of write-behind cache
I am looking for a simple illustration of using Ignite as a write-behind
cache with Hibernate (on
Oracle, not that that matters). What I have is this:
<application> == < Hibernate> === <Oracle JDBC>
I am looking to doing this:
<application> == *<Ignite cache>* === < Hibernate> === <Oracle JDBC>
I have looked through the example but am unable to find it. I do see
datagrid example -
thanx,
/Kobe
--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Simple-example-of-write-behind-cache-tp3439.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: Simple example of write-behind cache
Posted by vkulichenko <va...@gmail.com>.
Kobe,
No, this is a persistence store [1] implemented using Hibernate. When the
cache is updated, it will use Hibernate session to update the database. In
case of write-through consistency is guaranteed automatically by Ignite (if
cache update fails, it will not update the database, and other way around).
If there is a transaction, you can use CacheStoreSession and
CacheHibernateStoreSessionListener to maintain ongoing Hibernate transaction
and commit it only when the cache transaction is committed (this is also
demonstrated in the example).
L2 cache is also supported [2], but in this case Ignite is plugged into
Hibernate and you use Hibernate API to do updates and reads.
[1] https://apacheignite.readme.io/docs/persistent-store
[2] https://apacheignite.readme.io/docs/hibernate-l2-cache
-Val
--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Simple-example-of-write-behind-cache-tp3439p3446.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: Simple example of write-behind cache
Posted by Kobe <rk...@mailcity.com>.
Val,
Could you tell me how this works? Is this like a L2 cache for Hibernate?
How is cache coherence maintained? Using Hibernate session listener alone?
Thanx,
/Kobe
vkulichenko wrote
> Hi Kobe,
>
> Take a look at this example:
> https://github.com/apache/ignite/tree/master/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate
>
> Sounds like that's exactly what you need.
>
> -Val
--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Simple-example-of-write-behind-cache-tp3439p3444.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: Simple example of write-behind cache
Posted by vkulichenko <va...@gmail.com>.
Hi Kobe,
Take a look at this example:
https://github.com/apache/ignite/tree/master/examples/src/main/java-lgpl/org/apache/ignite/examples/datagrid/store/hibernate
Sounds like that's exactly what you need.
-Val
--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Simple-example-of-write-behind-cache-tp3439p3440.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.