2009-08-19 14:49:53 UTC
I was happy to see that some concurrency problems in DiskStore were fixed in 1.6.1, but upon upgrading from 1.6, I noticed a rather important breaking change. DiskStore v1.6.1 expects to find a ConcurrentHashMap on the ObjectInputStream, but it looks like DiskStore v1.6 wrote out a java.util.Collections$SynchronizedMap. I think a minor change could be made around line 874 of DiskStore to just expect a Map and copy it into a ConcurrentHashMap if it can't be cast to that. I could write a patch for it. Are there any version-to-version migration tests that would cover a situation like this?
Stacktrace:
net.sf.ehcache.CacheException: datasourceStateCache: Could not create disk store. Initial cause was java.util.Collections$SynchronizedMap cannot be cast to java.util.concurrent.ConcurrentHashMap
at net.sf.ehcache.store.DiskStore.<init>(DiskStore.java:177)
at net.sf.ehcache.Cache.createDiskStore(Cache.java:675)
Thanks,
Matt