HIBERNATE - Relational Persistence for Idiomatic Java

Using JBoss Cache 2 as a Hibernate Second Level Cache


Legal Notice

            1801 Varsity Drive
            Phone: +1 919 754 3700
            Phone: 888 733 4281
            Fax: +1 919 754 3701
            PO Box 13588Research Triangle ParkNC27709USA

Copyright © 2008 by Red Hat, Inc. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, V1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/).

Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder.

Distribution of the work or derivative of the work in any standard (paper) book form for commercial purposes is prohibited unless prior permission is obtained from the copyright holder.

Red Hat and the Red Hat "Shadow Man" logo are registered trademarks of Red Hat, Inc. in the United States and other countries.

All other trademarks referenced herein are the property of their respective owners.

The GPG fingerprint of the security@redhat.com key is:

CA 20 86 86 2B D6 9D FC 65 F6 EC C4 21 91 80 CD DB 42 A6 0E

1. Introduction
1.1. Overview
1.2. Requirements
1.2.1. Dependencies
1.2.2. JTA Transactional Support
1.3. Configuration Basics
2. Core Concepts
2.1. Types of Cached Data
2.1.1. Entities
2.1.2. Collections
2.1.3. Queries
2.1.4. Timestamps
2.2. Key JBoss Cache Behaviors
2.2.1. Replication vs. Invalidation vs. Local Mode
2.2.2. Synchronous vs. Asynchronous
2.2.3. Locking Scheme
2.2.4. Isolation Level
2.2.5. Initial State Transfer
2.2.6. Cache Eviction
2.2.7. Buddy Replication and Cache Loading
2.3. Matching JBC Behavior to Types of Data
2.3.1. The RegionFactory Interface
2.3.2. The CacheManager API
2.3.3. Sharable JGroups Resources
2.3.4. Bringing It All Together
3. Configuration
3.1. Configuring the Hibernate Session Factory
3.1.1. Basics
3.1.2. Specifying the RegionFactory Implementation
3.1.3. The SharedJBossCacheRegionFactory
3.1.4. The JndiSharedJBossCacheRegionFactory
3.1.5. The MultiplexedJBossCacheRegionFactory
3.1.6. The JndiMultiplexedJBossCacheRegionFactory
3.2. Configuring JBoss Cache
3.2.1. Configuring a Single Standalone Cache
3.2.2. Managing Multiple Caches via a CacheManager
3.2.3. JBoss Cache Configuration Details CacheMode NodeLockingScheme IsolationLevel JGroups Channel Configuration Initial State Transfer Region-Based Marshalling Eviction
3.2.4. Standard JBoss Cache Configurations
3.3. JGroups Configuration
3.3.1. Transport -- UDP vs. TCP
3.3.2. Standard JGroups Configurations
4. Cache Eviction
4.1. Overview
4.1.1. The Eviction Process
4.1.2. Eviction Regions
4.1.3. Eviction Policies The LRUPolicy The NullEvictionPolicy
4.2. Organization of Data in the Cache
4.2.1. Region Prefix and Region Name
4.2.2. Entities
4.2.3. Collections
4.2.4. Queries
4.2.5. Timestamps
4.3. Example Configuration
4.4. Best Practices
5. Architecture
5.1. Hibernate Interface to the Caching Subsystem
5.2. Single JBoss Cache Instance Architecture
5.3. Multiple JBoss Cache Instance Architecture