-
Notifications
You must be signed in to change notification settings - Fork 354
Introduce initial caching support #465
Comments
As a follow-up of #481, here is my proposal for a more efficient caching support. First, once spring-projects/spring-boot#25321 is merged, we should configure Second, we should update Third, we should update |
Tentatively scheduled for 0.9.0 since that's an important feature. |
@sdeleuze I can see this is blocked. Anything I can help you with? |
Thanks for the offer, I am progressing again on it after the discussion we had on #526. |
I gave it another try with Ehcache 3 and JSR 107, and ended up being blocked on unsafe access in ThreadLocalRandomUtil that I was not able to make it work despite what I think is proper unsafe field configuration. This is likely fixable but will require more time. That issue + the fact that we need a processor for creating dynamically the proxy configuration + the fact that we need time for proper testing, feedback and adding support for other mechanism clearly indicate to me that this is not doable for 0.9.0. I have pushed my work on sdeleuze@caching. Let's get back on this for 0.10.0. |
Not yet finished but could be useful if some users want to craft themselves the missing hints. See gh-465
Build fails on some samples otherwise See gh-465
It would also be nice to have caffeine working. Following this issue which implicates that Quarkus and Micronaut got it working: But still more and more Hints would be needed, because of the excessive use of Reflection. -- cut - not enought to get it working --- @typehint(typeNames = { |
Caffeine v3 no longer uses Unsafe, so that might help you get farther if somehow blocked on Ehcache due to that. The Quarkus folks suggested a compile-time evaluation, but I don't really understand Graal enough to implement and verify the suggestion. Any help making this easier for integrators would be appreciated. |
Thanks for your reply .. actually thats what i tried out, Caffeine v3 because it uses much less reflection ... unfortunately i still could not get this running, because still a lot of hints needed to be added, that i could not figure out. |
@ben-manes oh sorry .. Also one of the problems with version 3.x is, that its' compile with java 11. .. so I retried V3.x and it basically crashes with the exception below Caused by: java.lang.NoSuchFieldException: no such field: com.github.benmanes.caffeine.cache.UnboundedLocalCache.refreshes/java.util.concurrent.ConcurrentMap/getField |
Thanks for trying to get it all working. I’m not familiar with Graal and I’d be open to suggestions to make Caffeine better at supporting it. Sorry that you have to fight through this. oracle/graal#3028 sounds like VarHandles are not supported, leading to improper dead code elimination. I guess it is incompatible with 3.x for now. In 2.x there is a jandex resource that lists all of the reflections. It was removed in v3 as Quarkus decided it wasn’t necessary, but maybe that could help you bootstrap 2.x. Otherwise I’m at a loss as well. |
Thank you for your support. |
Let's try to provide initial caching support for Redis, the new AOT engine from 0.11 should make it much easier. |
I didn't see any discussion about Spring Native in the Github issue of EhCache. Based on the above discussion, can I assume that Spring Native and JCache (aka JSR107) configured via EhCache are still unavailable? |
The issue is still open, so yes. To a large extent, this is a bout adding the necessary hints on third party libraries though so the fix wouldn't probably come here. |
I'm sitting on some related attempts. As in https://www.ehcache.org/blog/2017/03/15/spontaneous-cache-creation.html , it seems that |
|
Spring Native is now superseded by Spring Boot 3 official native support, see the related reference documentation for more details. As a consequence, I am closing this issue, and recommend trying your use case with latest Spring Boot 3 version. If you still experience the issue reported here, please open an issue directly on the related Spring project (Spring Framework, Data, Security, Boot, Cloud, etc.) with a reproducer. Thanks for your contribution on the experimental Spring Native project, we hope you will enjoy the official native support introduced by Spring Boot 3. |
We have basic configuration for caching in
CachingHints
, but EhCache is not supported, and enabling caching support in PetClinic JPA with the following configuration:Generates this error that seems to indicate the need for a processor:
We should also document what kind of caching is supported (see the list in
CacheType
) and bring back caching support in thepetclinic-jpa
sample as configured in https://github.com/spring-projects/spring-petclinic.The text was updated successfully, but these errors were encountered: