Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » EclipseLink JPA: RMI cache coordination problem - cache not sync
EclipseLink JPA: RMI cache coordination problem - cache not sync [message #682222] Fri, 10 June 2011 16:32 Go to next message
imperfect  is currently offline imperfect Friend
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: EclipseLink JPA: RMI cache coordination problem - cache not sync [message #683417 is a reply to message #682222] Mon, 13 June 2011 17:33 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

What do you mean by frequently? Are the changes ever being coordinated? When are they/are they not?

Check your log for any errors.

Ensure you have given the servers enough time to setup communication with each other, and enough time for the change requests to be sent.



James : Wiki : Book : Blog : Twitter
(no subject) [message #683440 is a reply to message #682222] Mon, 13 June 2011 17:33 Go to previous messageGo to next message
James is currently offline JamesFriend
Messages: 272
Registered: July 2009
Senior Member
What do you mean by frequently? Are the changes ever being coordinated? When are they/are they not?

Check your log for any errors.

Ensure you have given the servers enough time to setup communication with each other, and enough time for the change requests to be sent.


--
James : http://wiki.eclipse.org/EclipseLink : http://en.wikibooks.org/wiki/Java_Persistence : http://java-persistence-performance.blogspot.com/
Re: (no subject) [message #684206 is a reply to message #683440] Wed, 15 June 2011 08:16 Go to previous messageGo to next message
imperfect  is currently offline imperfect Friend
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 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

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
Previous Topic:derived identifier of derived identifier
Next Topic:@Cache annotations set for the entire Peristence Unit
Goto Forum:
  


Current Time: Tue Dec 23 03:55:51 GMT 2014

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

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