I am configuring 2nd level cache with NHibernate 3.0. 2nd level cache works great for Entities and Collections but I also have some Entities which have filtered collections.
<bag name="EntityTrans" cascade="all-delete-orphan" table="EntityTrans">
<key column="entityId" not-null="true" />
<one-to-many class="MyDomain.EntityTran, MyDomain" />
<filter name="cultureFilter" condition=":cultureCode = CultureCode" />
</bag>
NHibernate 2nd level caching does not cache the above filtered collection. I can see in NHProf that for filtered collection queries are sent to database. My NHibernate config file has the following entries.
<class-cache class="MyDomain.EntityTran, MuDomain" region="MyRegion" usage="read-only"/>
<collection-cache collection="MyDomain.Entity.EntityTrans" region="MyRegion" usage="read-only"/>
Do I need to add something more to cache the filtered collection?