Menu

DiskStore breaking change in 1.6.1

2009-08-19
2013-05-14
  • Matthew Passell

    Matthew Passell - 2009-08-19

    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

     
    • Matthew Passell

      Matthew Passell - 2009-08-19
       
      • Matthew Passell

        Matthew Passell - 2009-08-20

        Done.  It's 2840648.  I'm very glad that it'll have a chance to make it in.

        --Matt

         
    • Greg Luck

      Greg Luck - 2009-08-20

      Matt

      Please submit a patch. I am putting out a 1.6.2 this weekend with some more fixes and patches. Hopefully 1.6.2 will fully stabilise 1.6.

      So please submit.

      Greg

       

Log in to post a comment.