-->
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.  [ 2 posts ] 
Author Message
 Post subject: hibernate ehcache
PostPosted: Sun Sep 26, 2010 5:58 pm 
Newbie

Joined: Sun Nov 01, 2009 9:24 pm
Posts: 12
hi,

i am trying to add a column to a table while using EhCahe as a second level caching for hibernate but it does now work.

how can i add/delete a column in the database when i am using the ehCache

i am using hibernate 3.5.6 and ehCache 2.2.0
Code:
<ehcache>
    <defaultCache
            maxElementsInMemory="10000"
            eternal="false"
            timeToIdleSeconds="300"
            timeToLiveSeconds="600"
            overflowToDisk="true"
            maxElementsOnDisk="10000000"
            diskPersistent="true"
            diskExpiryThreadIntervalSeconds="120"
            memoryStoreEvictionPolicy="LRU"
            />
    <cache
            name="org.hibernate.cache.StandardQueryCache"
            maxElementsInMemory="5"
            eternal="false"
            timeToLiveSeconds="120"
            overflowToDisk="true"/>

    <cache
            name="com.dynwar.user.service.UserServiceImpl"
            maxElementsInMemory="10000"
            eternal="false"
            timeToIdleSeconds="300"
            timeToLiveSeconds="600"
            overflowToDisk="true"
            />

    <cache
            name="com.dynwar.lottery.service.LotteryServiceImpl"
            maxElementsInMemory="10000"
            eternal="false"
            timeToIdleSeconds="300"
            timeToLiveSeconds="600"
            overflowToDisk="true"
            />

    <cache
            name="com.dynwar.todoList.service.TodoListServiceImpl"
            maxElementsInMemory="10000"
            eternal="false"
            timeToIdleSeconds="300"
            timeToLiveSeconds="600"
            overflowToDisk="true"
            />
</ehcache>

Code:
  <bean id="hibernateProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
        <property name="ignoreResourceNotFound" value="true"/>
        <property name="properties">

            <props>
                <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
                <prop key="hibernate.cache.use_second_level_cache">true</prop>
                <prop key="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</prop>
                <prop key="hibernate.show_sql">true</prop>
                <prop key="hbm2ddl.auto">update</prop>
                <prop key="hibernate.max_fetch_depth">1</prop>
                <prop key="hibernate.default_batch_fetch_size">32</prop>
                <prop key="hibernate.cache.region.factory_class">net.sf.ehcache.hibernate.EhCacheRegionFactory</prop>
                <prop key="hibernate.cache.use_query_cache">true</prop>
            </props>
        </property>

     
    </bean>


Top
 Profile  
 
 Post subject: Re: hibernate ehcache
PostPosted: Sun Sep 26, 2010 6:02 pm 
Newbie

Joined: Sun Nov 01, 2009 9:24 pm
Posts: 12
Do I need to turn off the caching and then add a column or is it possible to do it using the caching?


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

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.