Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Ignore Cache on Query

Do you want to ignore the cache, or not do the flush?

To disable flushing, you can either set the EntityManager flushMode, or
persistence unit property or use the query hint,

"eclipselink.flush"="Commit"

This will prevent to auto flush.

If you truly wish to ignore the cache, and build "detached" objects directly
from the database, you can use,

"eclipselink.maintain-cache"="false"

The hint, QueryHints.CACHE_USAGE, CacheUsage.DoNotCheckCache, just means
that a query will not check the cache before accessing the database, the
query will still flush, and will still use the cache and persistence context
when building the objects from the database result.


Michael Simons wrote:
> 
> Hello,
> 
> How can I tell EL to ignore the cache when executing a query, so there's
> no flush done before
> executing the query?
> Is this done by query.addHint(QueryHints.CACHE_USAGE,
> CacheUsage.DoNotCheckCache) ?
> 
> - michael
> 
> 


-----
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://old.nabble.com/Ignore-Cache-on-Query-tp27063185p27128928.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top