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
If an entity is cached as part of an object graph of another entity and them updated separately via em.merge, the reference in cache becomes out of sync and is not evicted, causing subsequent load of the referencing object to contain stale values.
For example, consider objectds a and b, where a has a reference to b.
The following sequence demonstrates the issue:
Load a. Both a and b are put into second-level cache.
2 Clear/close the EntityManager.
Edit some attributes of b and merge it into persistence context.
JOPA will evict b from cache. However, the b instance referenced by a stays in the cache.
Load a. It will be fetched from cache and contain b with now stale values.
The text was updated successfully, but these errors were encountered:
If an entity is cached as part of an object graph of another entity and them updated separately via
em.merge
, the reference in cache becomes out of sync and is not evicted, causing subsequent load of the referencing object to contain stale values.For example, consider objectds
a
andb
, wherea
has a reference tob
.The following sequence demonstrates the issue:
a
. Botha
andb
are put into second-level cache.2 Clear/close the
EntityManager
.b
and merge it into persistence context.b
from cache. However, theb
instance referenced bya
stays in the cache.a
. It will be fetched from cache and containb
with now stale values.The text was updated successfully, but these errors were encountered: