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

Description

Ehcache v1.4.0-beta:

net.sf.ehcache.event.RegisteredEventListeners is not thread-safe. We are receiving the following exception after a put() operation while another thread is registering a new listener:

java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793) at java.util.HashMap$KeyIterator.next(HashMap.java:828) at net.sf.ehcache.event.RegisteredEventListeners.notifyElementPut(RegisteredEventListeners.java:100) at net.sf.ehcache.Cache.put(Cache.java:677) at net.sf.ehcache.Cache.put(Cache.java:618) …

Looking at the source, there is nothing that we can synchronize on to provide thread-safety. Also, because RegisteredEventListeners is not an interface as is declared final, there is no way to inject a thread-safe replacement implementation into Cache.

Our application is highly concurrent application and relies cache listeners.

Please let me know if you need more information.

Thanks, Geoff. Sourceforge Ticket ID: 1811875 - Opened By: geoffreyarnold - 11 Oct 2007 21:58 UTC

Comments

Fiona OShea 2009-09-22

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