• Bug
  • Status: Closed
  • 2 Major
  • Resolution: Not a Bug
  • ehcache
  • drb
  • Reporter: hostalp
  • October 07, 2010
  • 0
  • Watchers: 0
  • July 27, 2012
  • October 08, 2010


Specifying ehcache via

is broken with Hibernate 3.5.6 (and also at least with 3.5.3):

java.lang.ClassCastException: org.hibernate.cache.ReadWriteCache$Item incompatible with net.sf.ehcache.hibernate.strategy.AbstractReadWriteEhcacheAccessStrategy$Lockable at net.sf.ehcache.hibernate.strategy.AbstractReadWriteEhcacheAccessStrategy.get(AbstractReadWriteEhcacheAccessStrategy.java:65) at org.hibernate.event.def.DefaultLoadEventListener.loadFromSecondLevelCache(DefaultLoadEventListener.java:586) at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:459) at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:227) at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:285) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:152) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1080) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:997) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:990) at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:610)

no problem with older style setup:

Please also review other stuff from the net.sf.ehcache.hibernate.strategy package as it may likely affect other cache types.


Alexander Snaps 2010-10-07

Could it be you are loading entries from disk (or some other persistent store), which contains values put by the previous SingletonEhCacheProvider ?

Petr H 2010-10-07

Actually it may be possible. There’s a chance some other instance in cluster was running at the same time, will check it out again ensuring all other instances are down first.

Petr H 2010-10-07

Alrught, after one more try with ensuring all cluster members are down it works fine. Is this possible issue documented somewhere? Perhaps it should to avoid such unnecessary confusions.

Alexander Snaps 2010-10-08

I’ve created another JIRA about documenting this properly: EHC-792