Hi,
I am using the NHib 1.2 beta 3.
I was trying to reassociate a entity using SaveOrUpdate(object) according to this post
http://forum.hibernate.org/viewtopic.php?t=966381&highlight=lock+update+reattach
and I kept getting the dreaded NonUniqueObjectException stating one of the CHILD objects was already in the ISession. I ran some checks to make sure just before I reattached it that the object (and its children) weren't associated and all was good. Turns out that in the SaveOrUpdate call there is a call to DoUpdateMutable() in SessionImp that checks for uniqueness AFTER it has already performed the Update...which means that reattaching will fail obviously.
I did the reattachment using Lock() and then Update() and both of those
worked just fine. Is this a bug or by design?
The post that includes Sergey's post (above) indicates that SaveOrUpdate is a valid way to reattach a nontransient instance to a Session.
MIKE