EclipseLink JPA: RMI cache coordination problem - cache not sync [message #682222] |
Fri, 10 June 2011 16:32 |
imperfect Messages: 4 Registered: June 2011 |
Junior Member |
|
|
Hi,
i am testing the EclipseLink JPA (version 2.2.0) RMI cache coordination feature in
weblogic server (10.3.4) for synchronous cache item replication.
test environment/scenario:
---------------------------------------------------------------------------
2 weblogic managed servers (both are member of a weblogic cluster)
running on the same PC (win xp) with JDK 1.6.0 update 25.
a simple application with 2 entity bean (with one-to-many relationship)
and a stateless session bean (which read and update the data by EntityManager.update/merge/find)
---------------------------------------------------------------------------
i follow the example here: http ://wiki.eclipse.org/EclipseLink/Examples/JPA/CacheCoordination .
the JMS cache coordination work perfectly (but i want synchronous cache replication).
for the RMI cache coordination, there is problem that, frequently, the data in the 2 caches becomes inconsistent after updating DB data with JPA API (e.g. EntityManager.update/EntityManager.merge)..
i.e. EntityManager.find(..) return out-dated entity objects.
i try to check the problem by turning on the eclipselink debug flag 'eclipselink.logging.level => ALL'.
from the log,there are some replication log, e.g. MergeChangeSet command being execute..
Any miss-configuration can cause such type of cache inconsistency?
Could anybody tell me what is the next step to troubleshoot this problem?
Is it possible to configure exlipselink to print more detail debug message about
the RMI cache coordination?
thank you.
lsp
[Updated on: Sat, 11 June 2011 06:13] Report message to a moderator
|
|
|
|
|
Re: (no subject) [message #684206 is a reply to message #683440] |
Wed, 15 June 2011 08:16 |
imperfect Messages: 4 Registered: June 2011 |
Junior Member |
|
|
Hi James,
>>>> What do you mean by frequently?
>>>> Are the changes ever being coordinated? When are they/are they not?
Ans: Sorry, i make a mistake, the change can be coordinate when updating the object by
EntityManager.merge or by changing the properties of the managed entity.
(Log printed:
Received remote command org.eclipse.persistence.sessions.coordination.MergeChangeSetCommand from Service[TestChannel, 2c30c4e6-3fd9-4b70-bc3b-c74d148948be, t3://pc1:7001/])
But, the change do not coordinated/replicated when i update the DB by query tool (e.g. sybase
iSQL), then i want to refresh the cache by calling 'EntityManager.refresh(...)' or EclipseLink
query hint 'eclipse.refresh'. Just only the cached items in the application/JVM, where the
EntityManager.refresh(..)' happened, be updated. Other peers' cached data not updated.
Btw, i use 'eclipselink.cache.coordination.propagate-asynchronously' to 'false' to ensure
synchronous RMI coordination/replication.
Thank you
[Updated on: Wed, 15 June 2011 08:50] Report message to a moderator
|
|
|
Re: (no subject) [message #684927 is a reply to message #684206] |
Thu, 16 June 2011 13:38 |
|
Cache coordination only coordinates changes made through EclipseLink, it does not coordinate changed made directly on the database. refresh() (nor any query) does not trigger any coordination.
If you want something refreshed, you would need to refresh on each server.
Or, you can use the EclipseLink cache invalidation API,
session.getIdentityMapAccessor().invalidateObject(object, true);
Passing true to invalidateObject will have the object invalidated across cache coordination.
James : Wiki : Book : Blog : Twitter
|
|
|
Powered by
FUDForum. Page generated in 0.03203 seconds