Hi to all,
I am having a problem with NHibernate and 2nd Level Cache trying to
retrieve collections.
In particular I get a cache miss with collection property (no items
contained in collection). Eg:
Item have a bag of Bid
In my Item entity, I've following property:
public IList<Bid> Bids { get; set; }
I get cache miss on following (note Model.Core.Item.Bids)
*Model.Core.Item.Bids*#60b8b2d6-4e60-489e-bd08-dce224941b6f
This is my version of NHibernate:
NHibernate 4.0.4 GA
NHibernate.Caches.SysCache.dll 4.0.0.4000
Following my mapping
<?xml version="1.0" encoding="utf-8" ?>
> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
> assembly="Model.Core"
> namespace="Model.Core">
> <class name="*Item*" lazy="false">
> <cache include="all" usage="read-write"/>
> <id name="Id" type="Guid"
> unsaved-value="00000000-0000-0000-0000-000000000000">
> <generator class="assigned" />
> </id>
> <property name="ItemDescription" />
> <bag name="Bids" lazy="false" inverse="true" cascade="all">
> <cache usage="read-write"></cache>
> <key column="idItem"></key>
> <one-to-many class="Bid" />
> </bag>
> </class>
> </hibernate-mapping>
<?xml version="1.0" encoding="utf-8" ?>
> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
> assembly="Model.Core"
> namespace="Model.Core">
> <class name="*Bid*" lazy="false">
> <cache usage="read-only"/>
> <id name="Id" type="Guid">
> <generator class="assigned"/>
> </id>
> <property name="Description" />
> <many-to-one name="Item" column="idItem" class="Item" lazy ="false"/>
> <set name="BidDetails" lazy="false" fetch="join" inverse="true"
> access="property">
> <cache usage="read-write"/>
> <key column="idBid"></key>
> <one-to-many class="BidDetail" />
> </set>
> </class>
> </hibernate-mapping>
I can provide more info or code sample.
Thank you very much
Maurizio
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.