I am using infinispan as hibernate 2nd level cache.
I want to confirm that cache is working properly as I have upgraded hibernate from 3 to 5 and infinispan to from 3 to 8. I am using javax.persistence 2.0.0
Entity definition is something like
@Entity
@Cacheable
public class Alert {
}
@Transactional(readOnly = true)
public List findAll() {
return this.session.createCriteria(Alert.class) .list();
}
I am calling above method findAll every 5 min. As alert entity is cacheable, should the values be fetched by cache instead of going to the database?
< logger name=“org.hibernate.cache” level=“DEBUG”/>
I have enabled logging of cache but I don’t see any logs showing it is fetching from the cache instead of going to the database.