Hibernate second-level caching (Intermediate)

In this recipe, we will cover the following topics:

  • Ehcache as caching engine provider in a Hibernate project
  • Hibernate second-level caching and its implementation

We will examine how to implement Hibernate second-level caching by integrating Ehcache as the cache provider. We also review what configuration is required to fully extend Ehcache in Hibernate.

Getting ready

Second-level caching is associated to the session factory object. This simply means that caching can be shared across multiple sessions instead of a per-session basis (first-level caching). Implementing second-level caching with Ehcache is one of the most utilized techniques in the industry.

In this recipe we discuss Ehcache integration with ...

Get Instant Effective Caching with Ehcache now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.