Is your application a web application?
Use Session.Merge(object)
In web applications, you sometimes serialize and de-serialize objects, then you create new objects, so even if NHibernate objects have the same identifier, the reference to the object is different. Then you try to update your de-serialized object, NHibernate discovers another object with the same identifier, but a different reference pointer, thus, does not know which of the objects in your memory is βcorrectβ.
In these cases, the Merge () method is used, so you can update the objects that are in your web application.
source share