• Bug
  • Status: Closed
  • Resolution: Fixed
  • drb
  • Reporter: sourceforgetracker
  • September 21, 2009
  • 0
  • Watchers: 0
  • September 22, 2009
  • September 22, 2009


ehcache 1.2.2 does not shutdown properly when used with hibernate 3.1.3 due to RMICachePeer objects which were unbound but not unexported. The reason for this is found in the net.sf.ehcache.distribution.RMICacheManagerPeerListener class. What we saw was that the notifyCacheRemoved method was called before dispose(). Thanks to the debugs it appeared as if all of the RMICachePeers were being removed successfully. Unfortunately, notifyCacheRemoved removes the RMICachePeer from the list of cachePeers and unbinds it, but does NOT unexport it. This means that dispose never gets a chance to run the local unbind method which both unbinds and unexports the RMICachePeers. It also means that the non daemon RMI Reaper will not allow any application using ehcache’s distributed caching to shutdown until those unbound, but still exported RMICachePeer objects, are garbage collected. Greg, attached is the RMICacheManagerPeerListener that Peter Chiang modified. Among the modifications is improved unexport handling in case the exported object is busy. In our testing these changes have corrected the shutdown issue and do not appear to introduce any new bugs.

BTW thanks for the distributed cache enhancement… this feature has proven VERY useful and quite stable:) Sourceforge Ticket ID: 1532610 - Opened By: sparhk - 1 Aug 2006 17:41 UTC


Fiona OShea 2009-09-22

Re-opening so that I can properly close out these issues and have correct Resolution status in Jira