Using Spring+JPA+Hibernate+Ehcache.
I am trying to cache Hibernate Collections in L2 Cache(Using EhCache).
The entity is annotated with @Cache(region=abc,strategy=READ_WRITE)
When I try to annotate the LAZY/EAGER loaded collection with @Cache annotation with same configurations, it results into the below mentioned exception:
java.lang.ClassCastException: org.hibernate.cache.ehcache.internal.nonstop.NonstopAwareEntityRegionAccessStrategy cannot be cast to org.hibernate.cache.spi.access.CollectionRegionAccessStrategy
The agenda here is to cache, all the data in the database on application start, to get the best performance.