Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Two-tier application: Turn off entire cache
icon5.gif  Two-tier application: Turn off entire cache [message #634291] Thu, 21 October 2010 07:39 Go to next message
No real name is currently offline No real nameFriend
Messages: 1
Registered: October 2010
Junior Member
Hello,

we're using EclipseLink in a two-tier architecture. We've already turned off the second level cache but are still experiencing problems with stale data regarding the find() method.

Is there any way to turn off L1 cache / identity map for those find() queries? At the moment we just do a refresh on the returned object but this just doesn't feel right.

Best regards,

Fabian
Re: Two-tier application: Turn off entire cache [message #634323 is a reply to message #634291] Thu, 21 October 2010 09:30 Go to previous messageGo to next message
Tom Eugelink is currently offline Tom EugelinkFriend
Messages: 807
Registered: July 2009
Senior Member
I also use Eclipselink in a fat (Swing) client, with multiple EntityManagerFactories and one EM per window. We configure EL like this to disable all EMF level caching (EM is ok):

lOptions.put(PersistenceUnitProperties.CACHE_SHARED_DEFAULT, "false"); // do not use the shared cache (otherwise refresh will not update from db)

(We use programmatic configuration, but there is a XML equivalent.)

Tom
Re: Two-tier application: Turn off entire cache [message #634448 is a reply to message #634291] Thu, 21 October 2010 18:15 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

An EntityManager must manage everything used in it persistence context. To avoid this, you must either create a new EntityManager (such as per transaction) or call clear() on the EntityManager.

EclipseLink also has support for a WEAK EntityManager.


James : Wiki : Book : Blog : Twitter
Previous Topic:EclipseLink - SQL Server - Unicode?
Next Topic:Standalone use of MOXy
Goto Forum:
  


Current Time: Sun Nov 23 02:30:29 GMT 2014

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

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