October 2006
Intermediate to advanced
880 pages
22h 11m
English
First we'll consider each entity class and collection and find out what cache concurrency strategy may be appropriate. After we select a cache provider for local and clustered caching, we'll write their configuration file(s).
The Category has a small number of instances and is updated rarely, and instances are shared between many users. It's a great candidate for use of the second-level cache.
Start by adding the mapping element required to tell Hibernate to cache Category instances.
<class name="auction.model.Category"
table="CATEGORY">
<cache usage="read-write"/>
<id ...
</class>
The usage="read-write" attribute tells Hibernate to use a read-write concurrency strategy ...