[Logo] Terracotta Discussion Forums
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
how do I know whether ehcache2.5.2 works or not?  XML
Forum Index -> Ehcache
Author Message
nuhsoah

neo

Joined: 06/15/2012 02:37:04
Messages: 2
Offline

Hi anybody,
I am a new boy in ehcache. I am using ehcache with hibernate, I have added the following properties in my hibernate.cfg.xml file:
<property name="cache.provider_class">net.sf.ehcache.hibernate.EhCacheProvider</property>
<property name="cache.use_second_level_cache">true</property>
<property name="cache.use_query_cache">true</property>
<property name="cache.region.factory_class">net.sf.ehcache.hibernate.EhCacheRegionFactory</property>

and I have finished to configure the ehcache.xml under my classpath:
<?xml version="1.0" encoding="UTF-8"?>

<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ehcache.xsd"
updateCheck="false" monitoring="off"
dynamicConfig="true">

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

<cacheManagerEventListenerFactory class="" properties=""/>

<defaultCache
maxEntriesLocalHeap="0"
eternal="false"
overflowToDisk="true"
timeToIdleSeconds="1200"
timeToLiveSeconds="1200">
<!--<terracotta/>-->
</defaultCache>

<cache name="sampleCache1"
maxEntriesLocalHeap="10000"
maxEntriesLocalDisk="1000"
eternal="false"
overflowToDisk="true"
diskSpoolBufferSizeMB="20"
timeToIdleSeconds="300"
timeToLiveSeconds="600"
memoryStoreEvictionPolicy="LFU"
transactionalMode="off"
/>
</ehcache>

Now, the key question is, how do I know whether ehcache works?
Jaza

journeyman

Joined: 04/15/2012 07:17:33
Messages: 28
Offline

You can enable Hibernate statistics and query them or make Hibernate expose them via JMX.

Here are two starting points:
http://stackoverflow.com/questions/1839299/tool-for-monitoring-hibernate-cache-usage

http://www.javalobby.org/java/forums/t19807.html

Don't forget to tell Hibernate which entities and queries it should cache.
nuhsoah

neo

Joined: 06/15/2012 02:37:04
Messages: 2
Offline

Jaza, thanks very mush.
rajoshi

seraphim

Joined: 07/04/2011 04:36:10
Messages: 1465
Offline

Issue seems to be resolved , closing the topic.

Rakesh Joshi
Terracotta.
 
Forum Index -> Ehcache
Go to:   
Powered by JForum 2.1.7 © JForum Team