Hi,
I would like to cache the results of a Named Query, but
org.hibernate.cache.StandardQueryCache.data remains empty. I've been reading through the documentation and forums and I
think that my configuration is correct. The maxElementsInMemory property has been explicitly set to a low value (1) to enforce Hibernate to use the file.
I would be pleased if someone could help me with this (simple) caching configuration :o).
SessionFactory
Code:
<prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.format_sql">true</prop>
<prop key="hibernate.use_sql_comments">true</prop>
<prop key="hibernate.generate_statistics">true</prop>
<prop key="hibernate.cache.use_query_cache">true</prop>
<prop key="hibernate.cache.use_second_level_cache">true</prop>
<prop key="hibernate.cache.use_structured_entries">true</prop>
Named Query Code:
<sql-query name="getDashboardItems">
<return alias="dashboardItem" class="..."/>
... </sql-query>
ehcache.xmlCode:
<cache name="org.hibernate.cache.StandardQueryCache"
maxElementsInMemory="1"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="true"/>
Regards, Stefan Lecho.
Hibernate version:
3.2.5.ga