Welcome to the Ehcache 2.9 Online Documentation Library
Ehcache 2.9 Release Notes
About Ehcache
What is Ehcache?
Basic Terms
Why Caching Works
Locality of Reference
Will an Application Benefit from Caching?
How Much Will an Application Speed up with Caching?
Topology Types
Storage Tiers
Automatic Resource Control
Installation Guide
Installing Ehcache for General-Purpose Caching
Installing Ehcache for Specific Technologies
Building Ehcache from Source
Product Documentation
Ehcache Developer Guide
Key Classes and Methods
About the Key Classes
CacheManager
Cache
Element
Basic Caching
Creating a CacheManager
Loading a Configuration
Adding and Removing Caches Programmatically
Performing Basic Cache Operations
Shutdown the CacheManager
JUnit Tests
Cache Usage Patterns
Supported Usage Patterns
cache-aside
cache-as-sor
read-through
write-through
write-behind
Copy Cache
Searching a Cache
About Searching
Making a Cache Searchable
Defining Attributes
Creating a Query
Obtaining and Organizing Query Results
Best Practices for Optimizing Searches
Concurrency Considerations
Options for Working with Nulls
Using Explicit Locking
About Explicit Locking
Code Sample for Explicit Locking
How Locking Works
The Locking API
Supported Topologies
Blocking and Self Populating Caches
About Blocking and Self-Populating Caches
Blocking Cache
SelfPopulatingCache
Transaction Support
About Transaction Support
Requirements for Transactional Caches
Configuring Transactional Cache
Working with Global Transactions
Failure Recovery
Sample Applications
Transaction Managers
Working with Local Transactions
Performance Considerations
Potential Timeouts in a Transactional Cache
Transactions in Write-Behind and Write-Through Caches
Support for Other Transaction Systems
Write-Through and Write-Behind Caches
About Write-Through and Write-Behind Caches
Using a Combined Read-Through and Write-Behind Cache
Write-Behind Sample Application
Configuring a Cache Writer
CacheWriterFactory Attributes
API
SPI
Monitoring the Size of Write-Behind Queue
Handling Exceptions that Occur After a Writer is Called
Cache Loaders
About Cache Loaders
Declarative Configuration
Implementing a CacheLoaderFactory and CacheLoader
Programmatic Configuration
Cache Manager Event Listeners
About CacheManager Event Listeners
Configuring a Cache Manager Event Listener
Implementing a CacheManager Event Listener Factory and CacheManager Event Listener
Cache Event Listeners
About Cache Event Listeners
Configuring a Cache Event Listener
Implementing a Cache Event Listener Factory and Cache Event Listener
Adding a Listener Programmatically
Cache Exception Handlers
About Exception Handlers
Declarative Configuration
Implementing a Cache Exception Handler Factory and Cache Exception Handler
Programmatic Configuration
Cache Decorators
About Cache Decorators
Built-in Decorators
Creating a Decorator
Declarative Creation
Programmatic Creation
Adding Decorated Caches to a CacheManager
Cache Extensions
About Cache Extensions
Declarative Configuration
Implementing a Cache Extension Factory and Cache Extension
Programmatic Configuration
Cache Eviction Algorithms
About Cache Eviction Algorithms
Built-in Memory Store Eviction Algorithms
Plugging in Your own Eviction Algorithm
Disk Store Eviction Algorithm
Class Loading
About Class Loading
Plugin Class Loading
Loading of ehcache.xml Resources
Ehcache Configuration Guide
Configuring Cache
About Ehcache Configuration
XML Configuration
Dynamically Changing Cache Configuration
Passing Copies Instead of References
Configuring Storage Tiers
About Storage Tiers
Configuring Memory Store
Configuring Disk Store
Sizing Storage Tiers
The Sizing Attributes
Pooling Resources Versus Sizing Individual Caches
Sizing Examples
Pinning and Size Limitations
Built-In Sizing Computation and Enforcement
Eviction When Using CacheManager-Level Storage
Managing Data Life
Configuration Options that Affect Data Life
Setting Expiration
Pinning Data
How Configuration Affects Element Flushing and Eviction
Data Freshness and Expiration
Configuring Restartability and Persistence
About Restartability and Persistence
Cache Persistence Implementation
Configuration Examples
Compatibility with Previous Versions
Configuring the Update Checker
Configuring the Update Checker
System Properties
Special System Properties
Ehcache Operations Guide
Tuning Garbage Collection
About Garbage Collection and Ehcache
Tuning the Garbage Collector
Monitoring and Management Using JMX
About Using JMX
MBeans
JMX Remoting
ObjectName Naming Scheme
The Management Service
JConsole Example
JMX Tutorial
Performance Considerations
Logging
SLFJ Logging
Recommended Logging Levels
Shutting Down Ehcache
About Shutdown
ServletContextListener
The Shutdown Hook
Dirty Shutdown
Debugging and Monitoring Replicated Caches
About the Remote Debugger
Using the Debugger
Ehcache Recipes
About the Recipes
Web Page and Web Page Fragment Caching
Using Grails and Ehcache
Data Freshness and Expiration
Caching Empty Values
Database Read Overload
Database Write Overload
Caching Methods with Spring 3 Annotations
Cache Wrapper
Reference Documentation
Related Documentation
Cache Server User Guide
What is Cache Server?
Installing the Cache Server Module
Requirements
Downloading
Installing the WAR File
Using the Cache Server with WebLogic
Installing the Standalone Server
Monitoring the Cache Server
About Monitoring the Cache Server
Remotely Monitoring the Standalone Server with JMX
Using the RESTful Services
About RESTful Web Services
The RESTful Web Services API
CacheManager Resource Operations
Cache Resource Operations
Element Resource Operations
Resource Representations
RESTful Code Samples
Curl Code Samples
Ruby Code Samples
Python Code Samples
Java Code Samples
Scala Code Samples
PHP Code Samples
Creating Massive Caches with Load Balancers and Partitioning
Using the W3C (SOAP) Web Service
About W3C (SOAP) Web Services
The W3C Web Services API
Security
Web Cache User Guide
About the Web Cache Module
Introduction
Components and Concepts
Caching Web Pages and Page Fragments
Sample Use Case
Steps for Caching Web Pages
Sample web.xml Configuration
Example web.xml Configuration
CachingFilter Exceptions
CachingFilter Exceptions
Ehcache Replication Guide
Using Replication
Supported Types of Replication
Minimum Configuration for Replication
Adding Replication to an Existing Cache
Replicated Caching Using RMI
Using RMI for Replicated Caching
Suitable Element Types
Configuring the Peer Provider
Configuring the CacheManagerPeerListener
Configuring Cache Replicators
Configuring Bootstrap from a Cache Peer
Complete Example
Common Issues with RMI Replication
Replicated Caching Using JGroups
Using JGroups for Replicated Caching
Suitable Element Types
Peer Discovery
Configuration
Example Configuration using UDP Multicast
Example Configuration using TCP Unicast
Protocol Considerations
Configuring CacheReplicators
Complete Sample Configuration
Common Issues with JGroups Replication
Replicated Caching Using JMS
Using JMS for Replicated Caching
Ehcache Replication and External Publishers
Configuration
External JMS Publishers
Code Samples
Using the JMSCacheLoader
Configuring Clients for Message Queue Reliability
Tested Message Queues
Common Issues using JMS-based Replication
Integrations
Using Ehcache with Hibernate
About Using Ehcache with Hibernate
Downloading and Installing Ehcache for Hibernate
Building with Maven
Configuring Ehcache as the Second-Level Cache Provider
Enabling Second-Level Cache and Query Cache Settings
Configuring Hibernate Entities to use Second-Level Caching
Configuring ehcache.xml Settings
Ehcache Settings for Domain Objects
Ehcache Settings for Collections
Ehcache Settings for Queries
The Demo Application and Tutorial
Performance Tips
Viewing Hibernate Statistics
Upgrading from Ehcache Versions Prior to 2.0
FAQ
Using Ehcache with ColdFusion
About ColdFusion and Ehcache
Example Integration
Using Ehcache with Spring
Using Spring 3.1
Spring 2.5 to 3.1
Annotations for Spring Project
Using Ehcache with JRuby and Rails
About Using Ehcache with JRuby
Installation
Configuring Ehcache for JRuby
Using the jruby-ehcache API directly
Using Ehcache from within Rails
Adding Off-Heap Storage under Rails
Using Ehcache with the Google App Engine
About Google App Engine (GAE) and Ehcache
Configuring ehcache.xml for Google App Engine
Use Cases
Troubleshooting
Sample Application
Using Ehcache with Tomcat
About Using Ehcache with Tomcat
Tomcat Issues and Best Practices
Using Ehcache with JDBC
About JDBC Caching
Adding JDBC caching to DAO/DAL
Sample Code
Using Ehcache with OpenJPA
Installation and Configuration
The Default Cache
Troubleshooting
For Further Information
Using Ehcache with Grails
About Using Ehcache with Grails
Using the Springcache Plugin
Using Web Sessions with Grails
Using Ehcache with GlassFish
Tested Versions of GlassFish
Deploying the Sample Application
Troubleshooting
Using Ehcache with JSR107
About Ehcache Support for JSR107
FAQ
Questions about Configuration
General Ehcache
Replicated Cache
Questions about Development
General Ehcache
Replicated Cache
Questions about Environment and Interoperability
General Ehcache
Replicated Cache
Questions about Operations
General Ehcache
Replicated Cache
Questions about Troubleshooting
General Ehcache
Replicated Cache
Questions about Errors and Warnings
General Ehcache
Replicated Cache
Welcome to the Ehcache 2.9 Online Documentation Library
Replicated Cache
to-ehcache_online_documentation_library
co-ehcache_release_notes
co-over_what_is_ehcache
co-cache_basic_terms
co-basics_locality_of_reference
co-basics_will_app_benefit
co-basics_how_much_speed_up
co-top_topology_types
co-store_storage_tiers
co-arc_automatic_resource_control
co-installing_ehcache_for_general_purpose_caching
co-installing_ehcache_for_specific_technologies
co-building_ehcache_from_source
to-key_classes_and_methods
co-key_about_key_classes
co-key_cachemanager
co-key_cache
co-key_element
to-codebasics_basic_caching
co-codebasics_creating_the_cachemanager
co-codebasics_loading_a_configuration
co-codebasics_adding_removing_caches
co-codebasics_performing_cache_operations
co-codebasics_shutting_down_cachemanager
co-codebasics_the_junit_tests
to-pattrn_cache_usage_patterns
co-pattrn_introduction_to_patterns
co-pattrn_cache_aside
co-pattrn_cache_as_sor
co-pattrn_read_through
co-pattrn_write_though
co-pattrn_write_behind
co-pattrn_copy_cache
to-srch_searching_a_cache
co-srch_about_searching
co-srch_making_cache_searchable
co-srch_defining_attributes
co-srch_creating_a_query
co-srch_obtaining_and_organizing_query_results
co-srch_best_practices_for_searches
co-srch_concurrency_considerations
co-srch_working_with_nulls
to-lock_using_explicit_locking
co-lock_about_locking
co-lock_example
co-lock_how_locking_works
co-lock_locking_methods
co-lock_supported_topologies
to-bsp_blocking_and_self_populating_caches
co-bsp_blocking_and_selfpopulating_classes
co-bsp_blocking_class
co-bsp_selfpopulating_class
to-tx_transaction_support
co-tx_about_transaction_support
co-tx_requirements_for_transactional_cache
co-tx_configuring_transactional_cache
co-tx_global_transactions
co-tx_failure_recovery
co-tx_sample_applications
co-tx_transaction_managers
co-tx_local_transactions
co-tx_performance_considerations
co-tx_potential_timeouts
co-tx_transactions_with_write-behind_through
co-tx_support_for_third_party_prods
to-writethrough_and_writebehind_caches
co-write_about_write_through_behind
co-write_using_combined_read_through_write_behind
co-write_sample_application
co-write_configuring_cache_writer
re-write_cache_writer_factory_attributes
co-write_api
co-write_spi
co-write_monitoring_size_of_queue
co-write_handling_exceptions
to-caload_cache_loaders
co-caload_about_cache_loaders
co-caload_declarative_configuration
co-caload_implementing_a_cache_loader_factory
co-caload_programmatic_configuration
to-cmlst_cache_manager_event_listeners
co-cmlst_about_cachemanager_listeners
co-cmlst_configuring_cachemanager_listener
co-cmlst_implementing_cachemanager_listener
to-clst_cache_event_listeners
co-clst_about_cache_listeners
co-clst_configuring_cache_listener
co-clst_implementing_listener_factory
co-clst_adding_listener_programatically
to-exhr_cache_exception_handlers
co-except_about_exception_handlers
co-except_declarative_configuration
co-except_implementing_handler_factory
co-except_programmatic_configuration
to-dec_cache_decorators
co-dec_about_cache_decorators
co-dec_builtin_decorators
co-dec_creating_a_decorator
co-dec_adding_cache_to_cache_manager
to-ext_cache_extensions
co-ext_about_cache_extensions
co-ext_declarative_configuration
co-ext_implementing_extension_factory
co-ext_programmatic_configuration
to-evict_cache_eviction_algorithms
co-evict_about_eviction_algorithms
co-evict_builtin_algorithms
co-evict_plugging_in_your_own_eviction_algorighms
co-evict_diskstore_eviction_algorighms
to-class_loading
co-class_about_class_loading
co-class_plugin_class_loading
co-class_loading_ehcache_xml
to-cfgbasics_configuring_cache
co-cfgbasics_about_cache_configuration
co-cfgbasics_xml_configuration
co-cfgbasics_dynamically_changing_cache_config
co-cfgbasics_passing_copies
to-tiers_configuring_storage_tiers
co-tiers_about_storage_tiers
co-tiers_configuring_memory_store
co-tiers_configuring_disk_store
to-size_sizing_storage_tiers
co-size_sizing_attributes
co-size_pooling_resources
co-size_sizing_examples
co-size_pinning_and_size_limits
co-size_builtin_resizing_computations
co-size_eviction_on_cache_manager_level_store
to-life_managing_data_life
co-life_options_affecting_data_life
co-life_setting_expiration
co-life_pinning_data
co-life_affect_on_flushing_and_eviction
co-life_data_freshness_and_expiration
to-persist_configuring_persistance_and_restart
co-persist_about_persistence_and_restart
co-persist_cache_persistence_implementation
co-persist_config_examples
co-persist_compatibility_with_prev_versions
to-updt_configuring_the_update_checker
co-updt_configuring_the_update_checker
to-jprop_system_properties
re-jprops_system_properties
to-tuning_garbage_collection
co-gc_about_garbage_collection
co-gc_tuning_garbage_collection
to-jmx_management_and_monitoring
co-jmx_about_using_jmx
co-jmx_mbeans
co-jmx_remoting
co-jmx_objectname_scheme
co-jmx_management_service
co-jmx_jconsole_example
co-jmx_tutorial
co-jmx_performance_considerations
to-log_logging
co-log_slf4j_logging
co-log_recommended_logging_levels
to-shut_shutting_down_ehcache
co-shut_about_shutdown
co-shut_servlet_context_listener
co-shut_the_shutdown_hook
co-shut_dirty_shutdown
to-rmi_debugging_replicated_caches
co-rmi_about_the_remote_debugger
co-rmi_using_the_debugger
to-pubhead_ehcache_recipes
co-recipe_about_the_recipes
co-recipe_web_page_and_fragment_caching
co-recipe_configure_grails_app_for_clustering
co-recipe_data_freshness_and_expiration
co-recipe_empty_cache_values
co-recipe_database_read_overload
co-recipe_database_write_overload
co-recipe_cache_wrapper
re-ehcache_reference_documentation
co-abt_what_is_the_cache_server
co-ins_requirements
co-ins_downloading_module
co-ins_installing_war_file
co-ins_using_cs_with_weblogic
co-ins_installing_standalone
co-mon_about_monitoring
co-mon_remote_jmx_monitoring
co-rest_about_rest_services
co-rest_rest_api
re_rest_cachemanager_ops
re_rest_cache_ops
re_rest_element_ops
re_rest_resource_representations
co-rest_code_samples
co-rest_creating_massive_caches
co-w3c_about_web_services
co-w3c_web_services_api
co-w3c_security
to-abt_about_the_web_cache_module
co-abt_what_is_the_web_caching_module
co-abt_components_and_concepts
to-use_using_web_cache_module
co-use_sample_use_case_for_caching_web_pages
co-use_steps_for_caching_web_pages
to-sam_sample_webxml_configuration
re-sam_webxml_configuration_example
to-exc_cachingfilter_exceptions
re-exc_additional_exceptions_from_cachingfilter
to-use_using_replication
co-use_supported_types
co-use_minimum_configuration
co-use_adding_replication_to_a_cache
to-rmi_replicated_caching_using_rmi
co-rmi_using_rmi
co-rmi_suitable_element_types
co-rmi_configuring_the_peer_provider
co-rmi_configuring_the_cache_manager_listener
co-rmi_configuring_cache_replicators
co-rmi_configuring_bootstrap
co-rmi_complete_example
co-rmi_common_issues_with_rmi_replication
to-jgrp_replicated_caching_using_jgroups
co-jgrp_using_jgroups
co-jgrp_suitable_element_types
co-jgrp_peer_discovery
co-jgrp_configuration
co-jgrp_example_config_using_udp_multicast
co-jgrp_example_config_using_tcp_unicast
co-jgrp_protocol_considerations
co-jgrp_configuring_cache
co-jgrp_complete_sample_configuration
co-jgrp_common_issues_with_jgroup_replication
to-jms_replicated_caching_using_jms
co-jms_using_jms
co-jms_ehcache_replication_and_external_publishers
co-jms_using_the_jms_cache_loader
co-jms_configuring_clients_for_message_queue_reliability
co-jms_tested_message_queues
co-jms_common_issues_with_jms_replication
to-hib_using_ehcache_with_hibernate
co-hib_about_using_ehcache_with_hibernate
co-hib_downloading_and_installing
co-hib_building_with_maven
co-hib_configure_as_second_level_cache_provider
co-hib_enable_second_level_cache_settings
co-hib_configuring_entities_to_use_second_level_caching
co-hib_configuring_ehcache_settings
co-hib_configuring_ehcache_settings_for_domain_objects
co-hib_configuring_ehcache_settings_for_collections
co-hib_configuring_ehcache_settings_for_queries
co-hib_the_demo_app
co-hib_performance_tips
co-hib_viewing_hibernate_statistics
co-hib_upgrading_from_versions_prior_to_2
co-hib_faq
to-cold_using_ehcache_with_coldfusion
co-cold_about_coldfusion_and_ehcache
co-cold_example_integration
to-spr_using_ehcache_with_spring
co-spr_using_spring_3_1
co-spr_using_spring_2_5_to_3_1
co-spr_annotations_for_spring
to-jruby_using_ehcache_with_jruby_and_rails
co-jruby_about_jruby_and_ehcache
co-jruby_installation
co-jruby_configuring_ehcache_for_jruby
co-jruby_using_the_jruby_ehcache_api
co-jruby_using_ehcache_from_within_rails
co-jruby_adding_bigmemory_under_rails
to-gae_using_ehcache_with_the_google_app_engine
co-gae_about_google_app_and_ehcache
co-gae_configuring_ehcache_xml
co-gae_typical_use_cases
co-gae_troubleshooting
co-gae_sample_application
to-tcat_using_ehcache_with_tomcat
co-tcat_about_using_ehcache_with_tomcat
co-tcat_tomcat_issues_and_practices
to-jdbc_using_ehcache_with_jdbc
co-jdbc_about_jdbc_caching
co-jdbc_adding_jdbc_to_dao_dal
co-jdbc_sample_code
to-opj_using_ehcache_with_openjpa
co-opj_installation_and_configuration
co-opj_the_default_cache
co-opj_troubleshooting
co-opj_further_information
to-grail_using_ehcache_with_grails
co-grail_about_grails_and_ehcache
co-grail_using_the_springcache_plugin
co-grail_using_web_sessions_with_grails
to-glass_using_ehcache_with_glassfish
co-glass_tested_versions
co-glass_deploying_sample_app
co-glass_troubleshooting
to-jsr_using_ehcache_with_jsr107
co-jsr_about_support_for_jsr107
re-faq_ehcache_configuration
re-faq_ehcache_development
re-faq_ehcache_environ_and_interop
re-faq_ehcache_operations
re-faq_ehcache_troubleshooting
re-faq_ehcache_errors_and_warnings