Problem with NHibernate and saving - NHibernate doesn't detect changes and uses old values.
- by Vilx-
When I do this:
Cat x = Session.Load<Cat>(123);
x.Name = "fritz";
Session.Flush();
NHibernate detects the change and UPDATEs the DB. But, when I do this:
Cat x = new Cat();
Session.Save(x);
x.Name = "fritz";
Session.Flush();
I get NULL for name, because that's what was there when I called Session.Save(). Why doesn't NHibernate detect the changes - or better yet, take the values for the INSERT statement at the time of Flush()?