• Bug
  • Status: Closed
  • 2 Major
  • Resolution: As Designed
  • ehcache
  • Reporter: xiqum
  • April 26, 2010
  • 0
  • Watchers: 0
  • July 15, 2010
  • June 23, 2010

Attachments

Description

Currently I am testing ehcache as a distributed object cache for a project. When testing with the distribution feature I encountered an issue. When you have for example two nodes sharing the same cache and are using the ‘RMICacheReplicatorFactory’ remove actions (also clear/removeAll) are only shared with the nodes that are ‘online’. I can reproduce the problem with this steps:

  • Bring online 2 nodes (two standalone machines)
  • Store data on node 1 and/or node 2
  • Stored data gets synchronized successfully
  • Remove data from 1 node, removes are successfully synced
  • Disconnect the network cable from node 2
  • Remove data from node 1 (remove or removeAll)
  • Reconnect the network cable on node 2
  • Add’s are successfully synced to node 2 but removes are not

I think there should be some kind of periodically check in the async replication module to see if there where one or more item’s removed in one of the cache’s (when the network was offline) . The attached file contains the Java code i use to create the cache.

Thanks in advance.

Comments

Fiona OShea 2010-06-23

Greg, what do you want to do with this?

gluck 2010-06-23

The RMI replication mechanism is not meant to be coherent. Incoherencies can occur in many ways, including the one that you have. It is a trade off that favours availability over consistency.

You can get a result closer to what you want by using JMS replication with persistent topics.

Finally you can achieve a fully coherent cache with much else besides by using the Terracotta server. This is straight forward in Ehcache 2.1.