Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Help on caching needed(how to setup eclipselink when it is used to access the same database in separate web apps?)
Help on caching needed [message #658131] Sun, 06 March 2011 21:21 Go to next message
Daniel Le Berre is currently offline Daniel Le BerreFriend
Messages: 82
Registered: July 2009
Member
Dear all,

I have three webapps A, B and C. They all rely on EclipseLink 2.1.2 to persist some entities (C actually just need to read data from the database, it does not modify it).

Each webapp is deployed separately in the servlet container (Tomcat).
(We are not in the context of JEE here, there is no way to deploy an ear with those webapps.)

My problem is the following: if I change the content of the database with one app, then the other apps do not see immediately the changes.

I guess that this is due to the default caching behavior.
http://wiki.eclipse.org/Introduction_to_Cache_%28ELUG%29

What is the best solution to deal with that problem?

Re: Help on caching needed [message #658150 is a reply to message #658131] Mon, 07 March 2011 06:50 Go to previous messageGo to next message
Tom Eugelink is currently offline Tom EugelinkFriend
Messages: 817
Registered: July 2009
Senior Member
I have the same problem with running separate fat clients; you need to disable the 2nd level cache. I will be at work in about an hour and can give you the code if you want.

Tom



On 6-3-2011 22:21, Daniel Le Berre wrote:
> Dear all,
>
> I have three webapps A, B and C. They all rely on EclipseLink 2.1.2 to persist some entities (C actually just need to read data from the database, it does not modify it).
>
> Each webapp is deployed separately in the servlet container (Tomcat).
> (We are not in the context of JEE here, there is no way to deploy an ear with those webapps.)
>
> My problem is the following: if I change the content of the database with one app, then the other apps do not see immediately the changes.
>
> I guess that this is due to the default caching behavior.
> http://wiki.eclipse.org/Introduction_to_Cache_%28ELUG%29
>
> What is the best solution to deal with that problem?
>
>
Re: Help on caching needed [message #658173 is a reply to message #658131] Mon, 07 March 2011 09:37 Go to previous messageGo to next message
Tom Eugelink is currently offline Tom EugelinkFriend
Messages: 817
Registered: July 2009
Senior Member
Here it is

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


On 6-3-2011 22:21, Daniel Le Berre wrote:
> Dear all,
>
> I have three webapps A, B and C. They all rely on EclipseLink 2.1.2 to persist some entities (C actually just need to read data from the database, it does not modify it).
>
> Each webapp is deployed separately in the servlet container (Tomcat).
> (We are not in the context of JEE here, there is no way to deploy an ear with those webapps.)
>
> My problem is the following: if I change the content of the database with one app, then the other apps do not see immediately the changes.
>
> I guess that this is due to the default caching behavior.
> http://wiki.eclipse.org/Introduction_to_Cache_%28ELUG%29
>
> What is the best solution to deal with that problem?
>
>
Re: Help on caching needed [message #658188 is a reply to message #658173] Mon, 07 March 2011 10:35 Go to previous message
Daniel Le Berre is currently offline Daniel Le BerreFriend
Messages: 82
Registered: July 2009
Member
Many thanks Tom!
Previous Topic:java.lang.SecurityException: signer information does not match signer information of other classes i
Next Topic:Eclipselink and Grails
Goto Forum:
  


Current Time: Tue Apr 23 12:01:29 GMT 2024

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

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

Back to the top