I have a project by NHibernate implementation and using Lazy Loading. I have three class in this project : Person, Identity and Family. Is mean a Person has a one Identity and a list of Family. Mapping is :
<class name="Person" table="Person_Person" >
<id name="Id" type="Int64" unsaved-value="0">
<generator class="native" />
</id>
<version name="Version" />
<property name="Name" column="Name"
type="String(255)" update="true" insert="true" access="property" not-null="false" />
<one-to-one name="Identity" property-ref="Person"
class="Domain.Entities.PersonIdentity,Domain.Entities" cascade="delete" fetch="select" />
<bag name="Families" inverse="true" table="Person_Family" cascade="all-delete-orphan" >
<key column="Person_id_fk"/>
<one-to-many class="Domain.Entities.Family,Domain.Entities"/>
</bag>
</class>
My problems is concurrency discuss. First problem is that : When a Person is updated, version field in Person table Will be updated and is true, But When a Identity is updated, version field in Person table Will not updated and is false. Why when Identity update, version field in Person table in Database not update?
Second problem is that : When a Family is added, version field in Person table Will be updated and is true, and When a Family is deleted, version field in Person table Will be updated and is true, But When a Family is updated, version field in Person table Will not updated and is false. Why when Family update, version field in Person table in Database not update?