You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I add LoadingCache on top of Spring Data Repository, so that it can load entities when needed, the application fails to start because beans in application context form a cycle.
Our contract is that the cache infrastructure is fully initialized by the time Hibernate starts so that it can be used for second level caching. Your sample requires hibernate to be fully loaded before the cache gets a chance to construct itself.
I supposed the sample is a simplistic view of what you're actually doing (as adding @Cacheable on the finder would do what all that code does). But there's not much else we should do here I am afraid. If you want to pursue using loading cache then you could consider injecting an ObjectProvider rather than requiring the full resolution of the repository on startup. Alternatively, your setup is super simple and you could create the CacheManager yourself so that things happen in the order that you want.
Uh oh!
There was an error while loading. Please reload this page.
When I add
LoadingCache
on top of Spring DataRepository
, so that it can load entities when needed, the application fails to start because beans in application context form a cycle.I created minimalistic sample: https://github.com/pmihalcin/spring-data-repository-cache for you to easily see the problem.
This issue occurs using Boot
2.0.5.RELEASE
, but it doesn't occur with Boot1.5.10.RELEASE
The text was updated successfully, but these errors were encountered: