|
Re: Caching or Isolations-Level Problem? [message #385307 is a reply to message #385301] |
Tue, 27 January 2009 13:04 |
|
An EntityManager represents an extended persistence context, so anything
read into an EntityManager will not be refreshed unless you explicitly
call refresh() on the object, or clear() the EntityManager. You can also
create a new EntityManager, and the life-cycle on an EntityManager
typically corresponds to one transaction or request.
EclipseLink also provides a query hint to refresh,
"eclipselink.refresh"="true".
EclipseLink also has a shared cache for the persistence unit, so anything
read can also be in the cache, and not refreshed until either explicitly
refreshed, or invalidated. To disable the EclipseLink cache set the
persistence.xml property "eclipselink.cache.shared.default"="false".
See also,
http://wiki.eclipse.org/Using_EclipseLink_JPA_Extensions_(ELUG)#Using_EclipseLink_JPA_Extensions_for_Entity_Caching
and,
http://wiki.eclipse.org/Optimizing_the_EclipseLink_Applicati on_(ELUG)#Optimizing_Cache
James : Wiki : Book : Blog : Twitter
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03678 seconds