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
To sum up, I hope EhCache 3 can provide the ability to configure DefaultPersistenceConfiguration in CacheConfigurationBuilder. Of course, if there is something I overlooked, it would be better to understand. Because https://stackoverflow.com/questions/65127520/set-ehcaches-persistence-directory-programmatically-on-spring-boot also has such doubts. Of course using XML to fully configure EhCache 3 can completely solve similar problems, but I'd much rather see the JavaConfig way.
Considering #3038 (comment) 's point of view, I don't think the issue discusses anything that needs attention anymore. So I'm going to close the issue.
ehcache3-example
, there is a detailed process in https://github.com/ehcache/ehcache3-samples/blob/master/fullstack/src/main/java/org/ehcache/sample/config/CacheConfiguration.java . In the configuration of this case, theDefaultPersistenceConfiguration
can be configured by a code snippet similar to the following. But this should not be handled well inehcache3-example
(points to https://github.com/ehcache/ehcache3-samples ) as it will result.public class CacheConfig extends CachingConfigurerSupport
should be changed topublic class CacheConfig implements CachingConfigurer
. Refer to Deprecate CachingConfigurerSupport and AsyncConfigurerSupport spring-projects/spring-framework#27813But if you use the
JCacheManagerCustomizer
recommended by Stéphane Nicoll in https://www.ehcache.org/blog/2017/03/15/spontaneous-cache-creation.html , It is logically impossible to configureDefaultPersistenceConfiguration
at all now. Because according to https://www.ehcache.org/documentation/3.9/107.html#cachemanager-level-configuration , configuringDefaultPersistenceConfiguration
must be at theorg.ehcache.jsr107.EhcacheCachingProvider
level ofEhCache 3
to process. Since the case used byehcache3-example
is actuallyjhipster
, I tried to find their latest use case, and whatjhipster
consider best practice now has becomeJCacheManagerCustomizer
. Refer to https://github.com/jhipster/jhipster-sample-app/blob/main/src/main/java/io/github/jhipster/sample/config/CacheConfiguration.java . Refer to Cache auto-configuration should consistently apply JSR-107 support spring-projects/spring-boot#3822 .To sum up, I hope EhCache 3 can provide the ability to configure
DefaultPersistenceConfiguration
inCacheConfigurationBuilder
. Of course, if there is something I overlooked, it would be better to understand. Because https://stackoverflow.com/questions/65127520/set-ehcaches-persistence-directory-programmatically-on-spring-boot also has such doubts. Of course usingXML
to fully configureEhCache 3
can completely solve similar problems, but I'd much rather see theJavaConfig
way.There is also a related issue related to this, that is, the documentation for integrating with Spring has not been relatively complete. See Add documentation about Spring and Hibernate #1910
The text was updated successfully, but these errors were encountered: