Pure Java configuration of Spring 5 (not Boot!), Hibernate 5 and ehCache 3
I’m trying to introduce an ehCache 3.x based 2nd level cache into an existing application which uses Spring Framework 5.3 and Hibernate 5.6. (Mind, we are not talking about a Spring Boot application.) I’d like to rely solely on Java-based configuration (i.e. @Configuration
classes), which would allow me to read configuration values (like max cache size, time to live etc.) at run-time from @PropertySource
s — as opposed to a static ehcache.xml
file, as showcased in the vast majority of tutorials out there.
Ideally, such a programmatic hibernate caching configuration mechanism should allow to