Thanks David/amila
I have read the docs & also setup the second level cache
But the problem is i am not able to get it to work.
Here is the configuration from applicationContext-Hibernate.xml
Code:
<property name="hibernateProperties">
<props>
<prop key="hibernate.cache.use_second_level_cache">true</prop>
<prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>
<prop key="hibernate.cache.use_query_cache">true</prop>
<prop key="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</prop>
<prop key="hibernate.cglib.use_reflection_optimizer">true</prop>
</props>
</property>
From the Log i get a message second level cache enabled
Code:
2007-06-26 10:48:27,876 INFO [org.hibernate.cfg.SettingsFactory] - <Second-level cache: enabled>
2007-06-26 10:48:27,876 INFO [org.hibernate.cfg.SettingsFactory] - <Query cache: enabled>
2007-06-26 10:48:27,876 INFO [org.hibernate.cfg.SettingsFactory] - <Cache provider: org.hibernate.cache.EhCacheProvider>
2007-06-26 10:48:27,907 INFO [org.hibernate.cfg.SettingsFactory] - <Optimize cache for minimal puts: disabled>
2007-06-26 10:48:27,907 INFO [org.hibernate.cfg.SettingsFactory] - <Structured second-level cache entries: disabled>
2007-06-26 10:48:27,907 INFO [org.hibernate.cfg.SettingsFactory] - <Query cache factory: org.hibernate.cache.StandardQueryCacheFactory>
Now the problem is , i have created a file by name ehcache.xml under src directory for query cache as follows
Code:
<cache name="query.allCDs"
........
.........
........
/>
It gives the following error
Code:
net.sf.ehcache.CacheException: Error configuring from file:/C:/apache-tomcat-5.5.17/webapps/namsNG/WEB-INF/classes/ehcache.xml. Initial cause was Error configuring from input stream. Initial cause was null:6: Element <cache> does not allow attribute "name".