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
Exposure of setStatisticsEnabled/setSampledStatisticsEnabled causes cache not initialized exception when chaches are defined as spring beans. [SPR-9392] #14028
The enhancement provided with #13497 causes an unintended side-effect during initialization of the cache via the factory.
When creating a cache by the factory bean, the method create cache attempts to set the properties statistics, sampledStatistics, and disabled before returning the cache. At the time this occurs the cache has not been registered with the cache manager and has not as yet been initialized. This is not a problem for disabled, but statistics & sampledStatistics both check to see if the cache has been initialized.
Would it be possible to move the code for the statistics & sampledStatistic up to afterPropertiesSet just before attempting to decorate the cache?
Obvious workaround would be to define the cache in the ehcache.xml configuration. This unfortunately is not workable for my current project.
I have emailed Jeurgen Hoeller with regard to this as well.