Hi All, During usage of NHibernate ...
One strange problem that I have bumped into was multiple updates after Session.Flush() command. No data actually changed ... Just wanted to perform Select that all, in my case there was 1000 updates – one per returned row!!!
Such behavior happens only if I’m using properties with custom PropertyAccessor as access type. The reason that I have created custom property was that I have uint and ushort types in my objects so I wanted to cast them from (long or Int32 correspondingly )on the Setter.
The question is how can I disable those updates or why my custom Setter causing such behavior?
void Set(object target, object value)
{
If(Value.GetType() == typeof(long))
{
Target.GetType().GetProperty(_propertyName).SetValue((uint)value);
}
}
Thanks in advance,
Update:------ How can i disable this dirty check before every Flush?