-->
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: "Cache is not alive"
PostPosted: Sat Sep 22, 2007 9:17 am 
Newbie

Joined: Wed Jul 05, 2006 9:04 am
Posts: 2
I'm trying to get 2'nd level caching to work and run into some strange error-messages. An IllegalStateException is thrown saying that "Cache is not alive" for the entities I've added caching for.

I haven't been able to find any documentation about "Cache is not alive" and don't know what it means.

Please send me in the right direction.

Or point me to an example I can follow...

Setup:

In an entity class I've added the line:

@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)

so that my entity class looks something like:

@Entity
@Table(name = "page")
@DiscriminatorColumn(name = "page_type", discriminatorType = DiscriminatorType.STRING)
@DiscriminatorValue("PAGE")
@Indexed
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class Page implements Child, java.io.Serializable{
...
}

In hibernate.cfg.xml I've setup ehcache like this:

<property name="cache.provider_class">
net.sf.ehcache.hibernate.EhCacheProvider
</property>

I've added the ehcache.xml file:

<ehcache>
<!-- Required elements -->
<diskStore path="java.io.tmpdir"/>
<defaultCache
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="true"/>

<!-- Cache settings per class -->
<cache name="com.asap.catalog.dao.Page"
maxElementsInMemory="1000"
eternal="false"
timeToIdleSeconds="300"
timeToLiveSeconds="600"
overflowToDisk="true"/>
</ehcache>

Thanks

Morten


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.