-->
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: needs help for caching
PostPosted: Thu Aug 17, 2006 6:05 am 
Newbie

Joined: Fri Aug 04, 2006 7:18 am
Posts: 2
Location: Chennai
Dear All,

I followed the following steps while caching

1. Download ehcache.jar and put it in your classpath

2. In hibernate.cfg.xml, declare ehcache as your cache provider using the hibernate.cache.provider_class property (hibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider). If you use spring, set the property in the 'hibernateProperties' of the session factory declaration.

3. In your hbm file, declare caching as follow :

<class
name="eg.MyClass"
table="MY_TABLE"
mutable="false"
>
<cache usage="read-only" />
.....
</class>

or

<class
name="eg.MyClass"
table="MY_TABLE"
>
<cache usage="read-write" />
.....
</class>

4. Create ehcache.xml in your classpath and write some cache region :

<ehcache>
<diskStore path="java.io.tmpdir"/>

<defaultCache
maxElementsInMemory="0"
eternal="false"
timeToIdleSeconds="0"
timeToLiveSeconds="0"
overflowToDisk="false"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="0"
memoryStoreEvictionPolicy="LFU"
/>

<cache name="eg.MyClass"
maxElementsInMemory="25"
eternal="false"
timeToIdleSeconds="86400"
timeToLiveSeconds="86400"
overflowToDisk="false"
memoryStoreEvictionPolicy="LFU"
/>
</ehcache>


After deploying on .data file is created in the C:\Winnt\Temp.
But it's size is only 0(Zero) bytes.
May I know is this Correct or not?

Please Help.

_________________
New to Hibernate


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.