openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ravi P Palacherla <>
Subject Re: L1 and L2cache.
Date Mon, 14 Nov 2011 15:32:44 GMT
EM2's persistence context is not closed and it is executing the queries
outside transaction.

The entity still exists in L1 cache and hence the old values are shown. How
to clear the L1cache ?
I think there are ways like, entityManager.clear() or refresh() or evict()
or using new entityManager.
But all of these are programatic approaches where there is a chance that
most of the times the data is not changed by EM1 but I still end up clearing
EM2's cache.

So is there a way I can tell openJPA , when a query is executed, to verify
if the objects in L1cache are out of sync with L2cache (or when a query goes
to datasource and L1cache values are different from the one's in datasource)
and if they are different then update the L1cache with values of L2cache or
datasource ?

View this message in context:
Sent from the OpenJPA Developers mailing list archive at

View raw message