Skip to content

Commit 1471cc4

Browse files
committed
mention extrenal updates in jdoc of Cache
1 parent b9c2f47 commit 1471cc4

File tree

1 file changed

+5
-0
lines changed
  • hibernate-core/src/main/java/org/hibernate

1 file changed

+5
-0
lines changed

hibernate-core/src/main/java/org/hibernate/Cache.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@
5050
* evict a whole cache region, or {@link #evictEntityData(Class, Object)}, to evict
5151
* a single item.
5252
* <p>
53+
* The second-level cache is never aware of changes made externally to Hibernate,
54+
* for example, directly via JDBC, or by another program. Therefore, programmatic
55+
* eviction might be required in order to ensure that such updates do not result
56+
* in stale data being read from the cache.
57+
* <p>
5358
* If multiple entities or roles are mapped to the same cache region, they share
5459
* policies and even the same FIFO-type expiry queue (if any). This sounds useful,
5560
* but comes with the downside that {@link #evictEntityData(Class)} for any one of

0 commit comments

Comments
 (0)