Hi Guys,
I have to disable second level catche for one Entity, I made
following change in my ehcache.xml, but i am getting warning message in jboss server log like "[Cache] Cache: com.csscorp.business.vo.TxnAlerts has a maxElementsInMemory of 0. It is strongly recommended to have a maximumSize of at least 1. Performance is halved by not using a MemoryStore." ehcache.xml -------------- <ehcache> <diskStore path="java.io.tmpdir"/>
<defaultCache maxElementsInMemory="10000" eternal="false" timeToIdleSeconds="120" timeToLiveSeconds="120" overflowToDisk="false" diskPersistent="false" diskExpiryThreadIntervalSeconds="120" memoryStoreEvictionPolicy="LRU" />
<cache name="com.csscorp.business.vo.TxnAlerts" maxElementsInMemory="0" overflowToDisk="false" />
</ehcache>
applicationcontext.xml -------------------------- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName"><value>com.mysql.jdbc.Driver</value></property> <property name="url"><value>jdbc:mysql://10.80.1.10:3306/GlobalHRMS_DEV?autoReconnect=true</value></property> <property name="username"><value>hrmsadmin</value></property> <property name="password"><value>c$$hr@dmin</value></property> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"><ref bean="myDataSource"/></property> <property name="mappingResources"> <list> <!--<value>/com/csscorp/dao/employee/employee.hbm.xml</value> --><value>/com/csscorp/dao/mastercode/mastercode.hbm.xml</value> <value>/com/csscorp/dao/login/login.hbm.xml</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.cache.use_second_level_cache">true</prop> <prop key="hibernate.cache.use_query_cache">true</prop> <prop key="hibernate.cache.provider_class">net.sf.ehcache.hibernate.EhCacheProvider</prop> <prop key="hibernate.cache.provider_configuration_file_resource_path">ehcache.xml</prop> </props> </property> </bean> </beans>
jar: hibernate-3.2.0.ga ehcache-1.2.3
but hibernate not disable TxnAlerts entity for his cache.
can you kindly pelase help me.
Thanks subbu
|