Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Query returning stale results existing

You can set cache setting per class in the EclipseLink orm XML file.  This
file can be used to supplement annotations or the JPA orm XML file, and will
be ignored by other JPA implementations, so is a portable way.  You can also
use the @Cache annotation, which is still portable as it will be ignored by
other JPA implementation, but does require a compile dependency.

persistence.xml properties can only do so much, more advanced settings need
a real XML file.



cowwoc wrote:
> 
> 
> James Sutherland wrote:
>> 
>> EntityManager.refresh() is the only way in the JPA spec to ensure an
>> object is refreshed.  If you use optimistic locking or the the read
>> lock() API you can guarantee that the transaction will fail if the object
>> is out of date.
>> 
>> EclipseLink also defines a Query hint "eclipselink.refresh" to allow a
>> query to force a refresh.  The are also may different caching options,
>> such as invalidation, auto-refreshing, isolation, and cache coordination.
>> 
> 
> EntityManager.refresh() worked :)
> 
> PS: It would be nice if cache expiration settings were available at the
> persistence.xml level. Ideally I want to isolate all EclipseLink-specific
> features to that file and keep my classes portable across all JPA
> implementations.
> 
> Thank you,
> Gili
> 


-----
---
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://www.nabble.com/Query-returning-stale-results-existing-tp20559804p20602036.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top