persistence@glassfish.java.net

RE: Stale data in the TopLink cache

From: Douglas Clarke <DOUGLAS.CLARKE_at_oracle.com>
Date: Mon, 26 Jan 2009 17:49:15 +0000 (GMT)

Björn,

There is no support in TopLink Essentials for managing a cache across multiple nodes. To view changes made in another node you will need to go back to the database. This can be done with setting the cache.shared setting to false for the entity classes where this situation arises or you can set TopLink to always refresh on all queries.

Alternatively you can upgrade to EclipseLink (www.eclipselink.org). This is the full open sourcing of our TopLink functionality and is replacing TopLink Essentials within GlassFish and within Oracle distributed products. EclipseLink offers cache coordination so that when one node of your application modifies an object it will notify other instances so they can update or invalidate the cached instance if they have it as well.

Doug

-----Original Message-----
From: BJörn Lindqvist [mailto:bjourne_at_gmail.com]
Sent: Monday, January 26, 2009 12:32 PM
To: persistence_at_glassfish.dev.java.net
Subject: Stale data in the TopLink cache


Sorry if this question has already been asked 100 times before..

I have two jvm:s on two servers that both access the same database via
TopLink. When one jvm updates a table in the database, I want that
update to be immediately reflected when data is fetched from the
database at the other machine. I want this behaviour for all tables in
the database. Is there some way to accomplish this without having to
turn off the TopLink cache? Should toplink.cache.shared.default be set
to false or is there another way?


-- 
mvh Björn