You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by monstereo <me...@gmail.com> on 2018/07/18 10:02:53 UTC

CRUD operation on Hibernate L2 Cache ?

I can run the example on github for hibernate l2 cache with ignite. And also
I am adding the new data to mydatabase like this command::
 
User user = new User("jedi", "Luke", "Skywalker");

 user.getPosts().add(new Post(user, "Let the Force be with you."));

   ses.save(user);

When I want to add new element to cache, it will also update the database.
When I want to update any element in cache, it will also update the
database.
When I want to delete any element in cache, it will also delete the element
from database.

How I can do that? I am allowed to use igniteCache.get, put, delete ?? 




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: CRUD operation on Hibernate L2 Cache ?

Posted by Mikhail <mi...@gmail.com>.
Hi Monstereo,


monstereo wrote
> When I want to add new element to cache, it will also update the database.
> When I want to update any element in cache, it will also update the
> database.
> When I want to delete any element in cache, it will also delete the
> element
> from database.
> 
> How I can do that? I am allowed to use igniteCache.get, put, delete ?? 
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/

If you want to use ignite as L2 cache for Hibernate, then it make sense to
use hibernate api for CRUD operations.
You can get entries directly from ignite cache, but I don't think that it's
a good idea, it's L2 cache and it's supposed to be accessed via Hibernate,
so in this case you should work with Hibernate API only.





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/