posted 14 years ago
Hi,
I'm using Hibernate 3.5 and ehcache 2.2.0 and have decided to improve my applications performance by implementing query caching. The problem I'm having is that according to the SessionFactory statistics, my second level query cache hits are 0 (i.e. I only get misses). However, if I watch my console I can see that the number of queries being executed by Hibernate on the database is reduced by about a 1/3. How can this be?
I have not marked any objects as cacheable, only a single query. Below is one of the queries, my relevant hibernate.cfg.xml settings, and the statistics.
Thanks.
Hibernate.cfg.xml
SessionFactory statistics after viewing the same page 3 times:
Query: