Did anyone try to get hibernate-ehcache to work with latest Spring Boot 3 and hibernate 6? Taken from the last updates to the library (6.0.0-alpha7 with last update in 2021) this seems not to be continued? Is there something new to replace it that I have missed so far?
Hibernate 6 Second Level Cache
Asked Answered
Use jcache (the standard API insteda of plain ehcache), which is now the recommended approach. Which is this dependency, and I suspect Spring Boot will manage the proper version for you. –
Impedimenta
The recommended approach is to use the JCache API instead of plain EhCache to do the caching. EhCache supports the JCache API so you can still use EhCache as the cache implementation.
Use the hibernate-jcache
dependency and configure it accordingly.
How to do the configuration is explained here in the Hibernate documentation.
Thanks. Will try this to replace hibernate-ehcache then. –
Menell
I wrote a post about how to use redisson as 2LC with spring boot and hibernate: https://blog.coffeebeans.at/archives/1919. I got rid of ehcache as redis was already in the project and redisson provides a compatible implementation that uses redis =)
If you have any questions, please let me know.
Thanks to M. Deinum for your hint to jcache to replace hibernate-ehcache.
© 2022 - 2024 — McMap. All rights reserved.