Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6829443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:30:03+00:00 2026-05-26T22:30:03+00:00

Based on following configuration I cannot enable ehcache statistics on xml file. There is

  • 0

Based on following configuration I cannot enable ehcache statistics on xml file. There is no such a property to enable ehcache statistics.

<bean id="cache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
  <property name="cacheName" value="diskCache"/>
  <property name="cacheManager" ref="cacheManager"/>
  <property name="maxElementsInMemory" value="1"/>
  <property name="overflowToDisk" value="true"/>
  <property name="maxElementsOnDisk" value="10"/>
</bean>

Ehcache 2.4.6 comes with disabled cache statistics.

Has anyone else had experience implementing this?

Any help or ideas on this would be MUCH appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:30:04+00:00Added an answer on May 26, 2026 at 10:30 pm

    Looks like the built-in EhCacheFactoryBean does not support setting this flag (I encourage you to open a feature request). However it is relatively easy to add this by yourself:

    package com.example;
    
    public class EhCacheWithStatisticsFactoryBean extends EhCacheFactoryBean {
    
        private boolean statisticsEnabled;
    
        @Override
        public void afterPropertiesSet() throws CacheException, IOException {
            super.afterPropertiesSet();
            getObject().setStatisticsEnabled(statisticsEnabled);
        }
    
        public void setStatisticsEnabled(boolean statisticsEnabled) {
            this.statisticsEnabled = statisticsEnabled;
        }
    }
    

    And usage:

    <bean id="cache" class="com.example.EhCacheWithStatisticsFactoryBean">
      <property name="cacheName" value="diskCache"/>
      <property name="cacheManager" ref="cacheManager"/>
      <property name="maxElementsInMemory" value="1"/>
      <property name="overflowToDisk" value="true"/>
      <property name="maxElementsOnDisk" value="10"/>
      <property name="statisticsEnabled" value="true"/> <!-- HERE -->
    </bean>
    

    Of course the easy path would be to use standard ehcache.xml file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Problem Given the following XML configuration file: <main> <name>JET</name> <maxInstances>5</maxInstances> <parameters> <a>1</a> <b> <b1>test1</b1>
Is there an easy method of accessing custom System.Configuration-based configuration data through a thread-safe
I have the following three components defined in the Caste-Windsor XML configuration for my
I have the following MSBuild project file: <?xml version=1.0 encoding=utf-8?> <Project xmlns=http://schemas.microsoft.com/developer/msbuild/2003 DefaultTargets=Deploy ToolsVersion=4.0>
I want to get specific value based on request from the property file.how to
MyBatis documentation shows a way to build a SqlSessionFactory through XML configuration file or
I have the following spring configuration: <context:component-scan base-package=uk.co.mysite.googlecontactsync.aop/> <bean name=simpleEmailSender class=uk.co.mysite.util.email.simple.SimpleEmailSenderImplementation/> <aop:aspectj-autoproxy/> Then I
Based on the following example URL structure: mysite.com/mypage.aspx?a=red&b=green&c=blue Pages in the application use ASP.net
Based on the following simple program the bitwise left shift operator works only for
Based on the following question: Check if one string is a rotation of other

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.