Hibernate 6 Second Level Cache
Asked Answered
M

2

6

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?

Menell answered 7/3, 2023 at 8:31 Comment(1)
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
I
7

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.

Impedimenta answered 7/3, 2023 at 9:19 Comment(1)
Thanks. Will try this to replace hibernate-ehcache then.Menell
M
1

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.

Menell answered 7/3, 2023 at 12:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.