0 Replies Latest reply on Jul 23, 2014 4:59 AM by Marek Dominiak

    Problems with cluster wide eviction in Infinispan - hibernate cache

    Marek Dominiak Newbie



      We are starting to use Infinispan as a 2L cache implementation for Hibernate. We have 2 application nodes and Infinispan caches are configured to be replicated - sync. I have tried to find out anything related to a cluster wide eviction but haven't found anything in the documentation.


      We use:

      - Hibernate 4.3.6.Final

      - Infinispan 6.0.2.Final


      We have a problem with the cluster wide eviction, I mean from time to time we need to update the database directly (omitting Hibernate infrastructure) and then we need to evict the entities / collections which have been changed.


      I'm using org.hibernate.Cache#evictEntityRegion(regionName) or org.hibernate.Cache#evictEntityRegion(entityName) (inside the scope of transaction).


      There are two problems which I stumbled upon:

      1. Eviction runs cluster wide, what is good, however on one of the two nodes the hibernate cache region is not restored - it looks like the region has been completely disabled (I can see that the SQL is generated on the console every time I try to get the same entry from the cache).

      Am I using the wrong API call or have I forgot to do something?  Can it be a bug in hibernate-infinispan module?


      2. JMX statistics are showing not completely valid data - e.g. if call to Cache#evictEntityRegion has been made on node 1 the statistics for node 2 are not updated (the number of entires hasn't decrease). Is there monitoring tool any other than JMX and hawtio?


      Is there any documentation related to cluster wide eviction?


      Thanks in the advance.



      Marek Dominiak