I have setup a session manager to issue a new session to each of my MDI child forms.
But when I try to save, I am getting a NullReferenceException.
This exception occurs when I try to commit my transaction after a SaveOrUpdate() call.
The object I am saving has a many-to-one property called LastUpdatedBy that identifies the user who change the object.
When trying to save that property, it throws the exception.
It is thrown from NHibernate.Engine.Cascades.VersionValue.IsUnsaved(object version)
The line that throws the exception:
Code:
return version == null || value.Equals(version);
This is because "version" = 5, but "value" is null. So the first part returns false but the value.Equals() throws an exception because value is null.
The object I am trying to save is not unsaved. (iow, it was loaded from the database via a QBE query)
Any hints on what might be wrong here?? I am using NHibernate 1.2.0.Alpha1.