Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » CacheRetrieveMode.BYPASS of EclipseLink is not useful.
CacheRetrieveMode.BYPASS of EclipseLink is not useful. [message #645315] Thu, 16 December 2010 15:39 Go to next message
KeatingWang  is currently offline KeatingWang Friend
Messages: 2
Registered: December 2010
Junior Member
Follow my code:

Company cc = em.find(Company.class, clientUser.getCompany().getId());
System.out.println(cc.getCompany_code());

HashMap findProperties = new HashMap();
findProperties.put(QueryHints.CACHE_RETRIEVE_MODE, CacheRetrieveMode.BYPASS);

Company oo = em.find(Company.class, clientUser.getCompany().getId(), findProperties);
System.out.println(oo.getCompany_code());


Just like the example "Used as EntityManager properties". here

But, there are nothing different between the two outputs.
Re: CacheRetrieveMode.BYPASS of EclipseLink is not useful. [message #646025 is a reply to message #645315] Tue, 21 December 2010 16:10 Go to previous messageGo to next message
Rich MacDonald is currently offline Rich MacDonaldFriend
Messages: 18
Registered: December 2010
Junior Member
>But, there are nothing different between the two outputs.

What outputs? The System.out.println outputs? There won't be any difference there. Why would you expect there to be any difference?

I presume you actually mean that you are running eclipselink in some detailed logging level, and that you have observed that eclipselink is NOT re-running the query on the dbase. Is this what you mean?
Re: CacheRetrieveMode.BYPASS of EclipseLink is not useful. [message #647126 is a reply to message #645315] Tue, 04 January 2011 16:40 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

I Believe there was a bug in the BYPASS not by-passing the find() cache check. I believe this was fix in the latest 2.2 development builds.

You can also use the query hints, "eclipselink.refresh"="true" or "eclipselink.maintain-cache"="false"


James : Wiki : Book : Blog : Twitter
Previous Topic:Compound Primary Key in InheritanceType.JOINED
Next Topic:Lazy load on OneToMany mapping does not work
Goto Forum:
  


Current Time: Thu Apr 25 10:37:04 GMT 2024

Powered by FUDForum. Page generated in 0.03961 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top