O'Reilly logo

Mastering Hibernate by Ramin Rad

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Caching strategies

One of the most important features of a relational database is support for concurrency and how multiple users can read from and write to the database. This is known as isolation level. The same concept is applicable in ORM cache.

Hibernate has built-in support for various concurrency strategies and isolation levels for a second-level cache. In this section, we will discuss various strategies and when you should use one over the other.

You should keep in mind that Hibernate defines its own isolation level, but a cache provider may offer other levels. When you choose a provider, you should consult the documentation to find out what isolation levels are supported. For example, Ehcache only supports READ-COMMITTED. However, Ehcache ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required