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 10:39 Go to next message
KeatingWang  is currently offline KeatingWang
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 11:10 Go to previous messageGo to next message
Rich MacDonald is currently offline Rich MacDonald
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 11:40 Go to previous message
James Sutherland is currently offline James Sutherland
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:ORA-24816 on insert with LOB
Next Topic:Lazy load on OneToMany mapping does not work
Goto Forum:
  


Current Time: Tue Jul 29 09:00:49 EDT 2014

Powered by FUDForum. Page generated in 0.03092 seconds