1 Reply Latest reply on Jun 14, 2016 2:57 AM by Radim Vansa

    Hibernate Second Level Cache Statistics do not match Infinispan's statistics

    Mark Haller Newbie

      I've been gettting statistics using the Hibernate Second Level Cache statistics API.  Say I have an entity called Foo (cacheName) I would get that like this:


        Statistics statistics = entityManager.getSession().getSessionFactory().getStatistics();
        SecondLevelCacheStatistics l2cacheStats =  statistics.getSecondLevelCacheStatistics(cacheName);


      For a given instance of Foo, I see:


            "entries" : [ ... 134 individual records ... ]
             "hitCount": 0,
              "missCount": 0,
              "putCount": 134,

      But, viewing the Infinsipan MBean (org.Infinispan.Cache) over JMX for the same entity Foo, I see hits:


      Before I dig into the internals of these two API can you think why there might be a difference?