HIbernate 3.5.1 - can I just drop in EHCache 2.0.1?
Posted
by caerphilly
on Stack Overflow
See other posts from Stack Overflow
or by caerphilly
Published on 2010-04-24T09:30:10Z
Indexed on
2010/04/24
9:33 UTC
Read the original article
Hit count: 194
I'm using Hibernate 3.5.1, which comes with EHCache 1.5 bundled.
If I want to use the latest EHCache release (2.0.1), is it just a matter of removing the ehcache-1.5.jar from my project, and replacing with ehcache-core-2.0.1.jar? Any issues to be aware of?
Also - is a cache "region" in the Hibernate mapping file that same as a cache "name" in the ehcache configuration xml? What I want to do is define 2 named cache regions - one for read-only reference entities that won't change (lookup lists etc), and one for all other entities. So in ehcache I want to define two elements;
<cache name="readonly"> ... </cache>
<cache name="mutable"> ... </cache>
And then in my Hibernate mapping files, I will specify the cache to be used for each entity:
<hibernate-mapping>
<class name="lookuplist">
<cache region="readonly" usage="read-only"/>
<property> ... </property>
</class>
</hibernate-mapping>
Will that work? Some of the documentation seems to imply that a separate region/cache gets created for each mapped class...
Thanks.
© Stack Overflow or respective owner