Knowledge on getting a database and cache

Given all the skills around Hibernate and the various caching strategies, how can I find out if any operation will result in deleting the physical database or from the cache?

+2
source share
3 answers

Traditionally, you will use built-in caching in Hibernate mode and do some profiling during development to tweak everything until you get the expected behavior. To enable cache logging, change the log level, for example when using log4j.xml :

 <logger name="org.hibernate.cache"> <level value="DEBUG" /> </logger> 

Please note that I do not recommend using this on a working platform (this can be very verbose and therefore can slow down execution).

See the logging documentation for more details.

+4
source

Hibernation statistics should tell you everything you need to know:

Inclusion: Hibernate Server Reference

Use: Hibernate: Use hibernation statistics when optimizing queries.

API: org.hibernate.stat.Statistics

+1
source

I am not sure, but I would try to increase the level of logging in the org.hibernate logs and see if this information is logged (this is most likely at the "debug" or lower level).

0
source

Source: https://habr.com/ru/post/1310426/


All Articles