Hibernate.initialize () and second level cache

Does anyone know if the Hibernate static initialize () method populating the proxy object will try to get into the second level cache before going to the database? My code seems to behave this way and I cannot find anything in the documentation about this. Javadok (as usual) is sparse.

Thank!

+3
source share
1 answer

This is true. As long as second-level caching is activated, and that your entity is declared cached, then the cache takes precedence if there is no explicit request. You can run the cache request / hit / miss to configure log. org.hibernate.cache .

+8
source

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


All Articles