Hi,
I am enabling the second level cache. I am also using some filters. When I inspected the Jboss cache log, I see in the logs that its ignoring the second level cache due to enabled filters. Is there any relationship between filters and second level cache. I could not get much details from documentation.
Thanks
Ashwani
Hibernate version:3.0
Mapping documents:
<hibernate-mapping> <class name="com.sony.spe.ifds.domain.CodeMaster" table="CODE_MASTER"> <cache usage="transactional" region="CodeMaster" /> ...
<set name="codeDetails" lazy="true" inverse="true" cascade="all,delete-orphan" order-by="SORT_ORDER"> <cache usage="transactional" region="CodeMaster" /> <key column="CODE_MASTER_ID"/> <one-to-many class="com.sony.spe.ifds.domain.CodeDetail"/> <filter name="codeDetailFilter" condition=":languageCd = LANGUAGE_CD"/> </set> </class>
<filter-def name="codeDetailFilter"> <filter-param name="languageCd" type="string"/> </filter-def>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
Debug level Hibernate log excerpt:
19 Jan 2006 17:18:32,488 DEBUG event.def.DefaultInitializeCollectionEventListener - initializing collection [com.sony.spe.ifds.domain.CodeMaster.codeDetails#1003309] 19 Jan 2006 17:18:32,488 DEBUG event.def.DefaultInitializeCollectionEventListener - checking second-level cache 19 Jan 2006 17:18:32,488 DEBUG event.def.DefaultInitializeCollectionEventListener - disregarding cached version (if any) of collection due to enabled filters 19 Jan 2006 17:18:32,488 DEBUG event.def.DefaultInitializeCollectionEventListener - collection not cached
|