After implement Hibernate Monitoring, i have noticed that hibernate execute too much query than it have on the query string table in statistics.
Screen-shots of statistics:
I think, implement hibernate 2nd level cache and particularly hibernate query cache help me to reduce this amount of query execute.
I searched on the web, on find many provider class for the cache of hibernate. But I'm not succeeded to implement it (infinispan, EhCache).
My questions are :
- Do you think, it is the most appropriate method to reduce this amount of query execute, knowing that the query string table contains much less query ?
- Do you have some example of implementation o开发者_JAVA百科f this 2nd level cache with latest version of hibernate (3.5.5 final).
Thank you in advance for you help.
Best regards,
Florent,
Do you think, it is the most appropriate method to reduce this amount of query execute, knowing that the query string table contains much less query ?
It really depends on the type of application. Does the DB have trouble responding to this much queries? Adding a second-level cache on your web server will require additional ram. Do you have available ram on the web server?
Additionally, second-level cache is really useful for queries that return constants/or data that are not modified often (ex: taxes rates). Data that are modified a lot (ex. inventory) should not be put in the second-level cache.
Do you have some example of implementation of this 2nd level cache with latest version of hibernate (3.5.5 final).
What errors did you have in your implementation? There is already a lot of configurations available on the web.
精彩评论