Hi all,
my problem is the following: when I added caching to my application server is gone crazy. Hibernate log tells me that objects and queries are cached and the succeeding calls get a "Cache hit", but, in reality, client requests are not satisfied due to expiry.
I really don't know where is the problem. I've tried with two different caching implementations (ehcache and memcached) but the result is the same.
Here is my hibernate.cfg.xml:
Code:
<property name="transaction.manager_lookup_class">org.hibernate.transaction.SunONETransactionManagerLookup</property>
<property name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
<property name="cache.use_second_level_cache">true</property>
<property name="cache.use_query_cache">true</property>
<!-- Mapping settings -->
<mapping resource=".../City.hbm.xml"/>
<mapping resource=".../Country.hbm.xml"/>
<mapping resource=".../Region.hbm.xml"/>
<!-- Cache settings -->
<class-cache class="...City" usage="nonstrict-read-write"/>
<class-cache class="...Country" usage="nonstrict-read-write"/>
<class-cache class="...Region" usage="nonstrict-read-write"/>
Queries that I wanna cache are marked as cacheable.
Anyone can help me, please???
Thanks in advance ;)