[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-users] Ignore Cache on Query
|
Hello James,
I do not want that a flush is made, before the query runs, because I "know" that the changes
made do not affect the query, so I will try the "eclipselink.flush=commit".
Thanks a lot,
Michael
James Sutherland schrieb:
> 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
--
mit freundlichen Grüßen,
Michael Simons
OPTITOOL GmbH
Bruderwöhrdstr. 15b
93055 Regensburg
Tel: +49(0)941.595780
Fax: +49(0)941.595787