Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Hibernate

You're reading from   Mastering Hibernate Learn how to correctly utilize the most popular Object-Relational Mapping tool for your Enterprise application

Arrow left icon
Product type Paperback
Published in May 2016
Publisher Packt
ISBN-13 9781782175339
Length 204 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

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 can in fact participate in JTA transaction (global transaction) and, therefore, supports two-phase commit.

Hibernate provides an interface to access strategy for different types, such as EntityRegionAccessStrategy, which specifies the contract to access...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image