Hello everyone,
I use to JBoss [EAP] 5.0.0.GA, Hibernate 3.3.2.GA and ehcache-core-2.0.0. I did my config files from
ehcache page.My peesistence.xml
Code:
<property name="hibernate.cache.region.factory_class" value="net.sf.ehcache.hibernate.EhCacheRegionFactory"/>
<property name="net.sf.ehcache.configurationResourceName" value="META-INF/ehcache.xml"/>
<property name="hibernate.cache.use_minimal_puts" value="false"/>
<property name="hibernate.cache.use_query_cache" value="true"/>
<property name="hibernate.cache.use_second_level_cache" value="true"/>
Everything looks good when the server starts:
INFO [SettingsFactory] JPA-QL strict compliance: enabled
INFO [SettingsFactory] Second-level cache: enabled
INFO [SettingsFactory] Query cache: enabled
INFO [SettingsFactory] Cache region factory : net.sf.ehcache.hibernate.EhCacheRegionFactory
INFO [SettingsFactory] Optimize cache for minimal puts: disabled
INFO [SettingsFactory] Structured second-level cache entries: disabled
INFO [SettingsFactory] Query cache factory: org.hibernate.cache.StandardQueryCacheFactory
INFO [SettingsFactory] Statistics: enabled
INFO [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
INFO [SettingsFactory] Default entity-mode: pojo
INFO [SettingsFactory] Named query checking : enabled
but if I want to use my cached data, I have:
Code:
Caused by: java.lang.NullPointerException
at net.sf.ehcache.hibernate.strategy.AbstractReadWriteEhcacheAccessStrategy$Item.isWriteable(AbstractReadWriteEhcacheAccessStrategy.java:250)
at net.sf.ehcache.hibernate.strategy.AbstractReadWriteEhcacheAccessStrategy.putFromLoad(AbstractReadWriteEhcacheAccessStrategy.java:91)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:179)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:877)
at org.hibernate.loader.Loader.doQuery(Loader.java:752)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
at org.hibernate.loader.Loader.doList(Loader.java:2232)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129)
at org.hibernate.loader.Loader.list(Loader.java:2124)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:118)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1597)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:306)
at org.hibernate.impl.CriteriaImpl.uniqueResult(CriteriaImpl.java:328)
Have you ever seen something like this?