查看hibernate中的话语缓存情况

查看hibernate中的语句缓存情况

hibernate 中的语句缓存情况:

 

需要通过hibernate自身的统计功能来确认。

 

--------------------

 

参考:

 

AFAIK, Hibernate transforms all sql to prepared statement form before issuing it to the database. When tuning the application, the size of prepared statement cache can be an important factor. How to determine the optimum value when using Hibernate, given that it creates prepared statements “under the hood”.

 

Generally you'd try to obtain such statistics from your database after letting the application run its normal course for a certain period of time.

You can also enable statistics and SQL logging in Hibernate configuration and analyze the data obtained.