NHibernate 1.2.1.4000
I´m new here, so hello all!
I encountered some strange behaviour with the incrementation of the version column. A very simple Example:
There is an Employee with a related Person. Both mappings contain a <version> tag. The Employee´s Person assoziation is declared as lazy="true".
If I load the Employee, modify a Employee specific Property (e.g. personnelNumber) and update this Employee the version of the Employee is incremented by 1. That seems correct.
But if I either switch the Employee´s Person assoziation to lazy="false" or fetch the Person by calling employee.Person and do exactly the same Update as described above the Person´s version number is incremented too, although I did not change the Person at all.
That seems odd! This behaviour applies to the complete object graph, if the person refernces a list of contacts for example this versions are incremented too.
So please give me some advice of how to handle that! For me the only usefull behaviour would be that solely the employee´s version gets incremented, because it was solely the employee I changed. No matter whether the relations are lazy="false" or are fetched by a call.
Anyway, excuse my english!
Regards,
Christian
|