Ray's playground

 

Transactions, concurrency, and caching(Chapter 5 of Hibernate In Action)

  Hibernate provides a dual-layer caching system with a first-level object cache (the Session) and a pluggable second-level data cache. The first-level cache is
always active—it’s used to resolve circular references in your object graph and to optimize performance in a single unit of work. The (process or cluster scope) second-level cache on the other hand is optional and works best for read-mostly candidate classes. You can configure a non-volatile second-level cache for reference
(read-only) data or even a second-level cache with full transaction isolation for critical data. However, you have to carefully examine whether the performance gain is
worth the effort. The second-level cache can be customized fine-grained, for each persistent class and even for each collection and class association. Used correctly
and thoroughly tested, caching in Hibernate gives you a level of performance that is almost unachievable in a hand-coded data access layer.

posted on 2010-07-17 10:40  Ray Z  阅读(205)  评论(0)    收藏  举报

导航