I am experiencing some odd behaviour with NHibernate. I'm retrieving a list of Learners from a repository, updating them as necessary, the odd thing is when I save the first one, the changes made to all the learners are being commited to the database.
[Transaction]
public void UpdateLearner(Learner learner)
{
//UnitOfWork.CurrentSession.Save(learner);
}
Any ideas why? I dont have caching enabled. I know its something to do with the transaction as the changes get persisted even with the call to the save method commented out.
This is my mapping:
<class name="Learner" table="ILR_Learner">
<id name="Id" column="ILRLearnerID">
<generator class="native" />
</id>
<property column="LastWarning" name="LastWarning" type="DateTime" />
<property column="Submitted" name="SuccessfulSubmission" type="DateTime" />
<join table="vwLearnerLSCUpload">
<key column="ILRLearnerID" foreign-key="ILRLearnerID"/>
<property column="Dog" type="DateTime" name="Dog"/>
</join>
<join table="Learner">
<key column="Id" foreign-key="ILRLearnerID"/>
<property column="Food" name="Food" type="String" length="20" />
</join>
</class>