I am trying to inspect the second level cache by calling
Code:
session.getSessionFactory().getStatistics().getSecondLevelCacheStatistics("regionName").getEntries()
and I get
Code:
java.lang.ClassCastException: java.lang.String cannot be cast to org.hibernate.cache.CacheKey
at org.hibernate.stat.SecondLevelCacheStatistics.getEntries(SecondLevelCacheStatistics.java:74)
I don't get this if I do not specify <terracotta clustered="true"/> in ehcache.xml for this region. It looks like the key is some kind of terracotta specific value and not the CacheKey object hibernate expects.
Edit: I am using ehcache-core 1.7.2 and ehcache-terracotta 1.8.0