-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Second Level Cahche disble For a particular Entity
PostPosted: Fri Aug 07, 2009 8:02 am 
Newbie

Joined: Fri Aug 07, 2009 7:38 am
Posts: 3
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.