Using NHibernate 3
One of my objects has been getting marked as being modified which sets
off a chain reaction to update a bunch of related objects and I have
no idea why. In all the objects that get modified, the only thing that
changes is their version number so it makes me think its something to
do with the sets.

If I do just something simple like this:

Rosmat rosmat = Session.Get<Rosmat>(id);
ITransaction tx = Session.BeginTransaction();
tx.Commit();

Then the Rosmat object I got and a bunch of other related objects get
their version numbers updated.

Here's my mapping:

<class name="DatabaseModel.Models.Rosmat, DatabaseModel"
table="Rosmat" >
        <cache usage="nonstrict-read-write" region="RosmatCache" />
        <id name="RefId" type="guid">
                <generator
class="DatabaseModel.Services.DataIntegrity.GuidExistingGenerator,
DatabaseModel" />
        </id>
        <version name="Version" type="Int32" generated="never">
                <column name="Version" not-null="true" />
        </version>
        <property name="Title" column="Title" type="string" not-null="true"/>
        <property name="AbbrevTitle" column="AbbrevTitle" type="string" not-
null="false"/>
        <property name="Expiration" column="Expiration" type="date" not-
null="false"/>
        <property name="ImportCode" column="ImportCode" type="string" not-
null="false"/>

        <property name="MarkingRule" column="MarkingRule" type="int" not-
null="true"/>

        <property name="JsonStorageString" type="string" >
                <column name="JsonStorage" sql-type="nvarchar(max)" not-
null="false" />
        </property>

        <many-to-one name="Owner" column="OwnerUserInfoRefId"
class="DatabaseModel.Models.UserInfo"/>
        <many-to-one name="School" column="SchoolInfoRefId"
class="DatabaseModel.Models.SchoolInfo"/>

        <set name="StudentLists" order-by="title" lazy="true">
                <cache usage="nonstrict-read-write" region="RosmatCache" />
                <key column="RosmatRefId" />
                <one-to-many class="DatabaseModel.Models.StudentList" />
        </set>

        <set name="RosmatPermissions" lazy="true">
                <key column="RosmatRefId" />
                <one-to-many class="DatabaseModel.Models.RosmatPermission" />
        </set>

        <set name="Specialties" table="RosmatSpecialty" lazy="true">
                <key column="RosmatRefId" />
                <many-to-many column="SpecialtyRefId"
class="DatabaseModel.Models.Specialty" />
        </set>

        <set name="SourceRosmats" table="SourceRosmat" lazy="true">
                <key column="RosmatRefId" />
                <many-to-many column="ParentRosmatRefId"
class="DatabaseModel.Models.Rosmat" />
        </set>
</class>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to