You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/src/main/asciidoc/introduction/Tuning.adoc
+16-3Lines changed: 16 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -410,7 +410,7 @@ Therefore, by default, an entity is not eligible for storage in the second-level
410
410
We must explicitly mark each entity that will be stored in the second-level cache with the link:{doc-javadoc-url}/org/hibernate/annotations/Cache.html[`@Cache`] annotation from `org.hibernate.annotations`.
411
411
412
412
But that's still not enough.
413
-
Hibernate does not itself contain an implementation of a second-level cache, so it's necessary to configure an external _cache provider_.
413
+
Hibernate does not itself contain an implementation of a second-level cache, so it's also necessary to configure an external _cache provider_.
414
414
415
415
[CAUTION]
416
416
// .Caching is disabled by default
@@ -430,6 +430,14 @@ Each region is permitted its own policies for expiry, persistence, and replicati
430
430
431
431
The appropriate policies depend on the kind of data an entity represents. For example, a program might have different caching policies for "reference" data, for transactional data, and for data used for analytics. Ordinarily, the implementation of those policies is the responsibility of the underlying cache implementation.
432
432
433
+
[WARNING]
434
+
====
435
+
The second-level cache is never aware of any changes to data which are made externally to Hibernate.
436
+
Updates made via direct JDBC--or by some other program--are never visible in the second-level cache.
437
+
When such updates occur, we might need to <<second-level-cache-management,explicitly invalidate cached data>>.
438
+
Alternatively, in cases where the program is able to tolerate somewhat stale data, an expiry policy might be an acceptable solution.
0 commit comments