Try a session.Get on the id before calling the SaveOrUpdate so that NHibernate Sessions knows about the object
John Davidson On Fri, Feb 18, 2011 at 4:38 PM, gwh <[email protected]> wrote: > Hi, > > I have an NHibernate object that is loaded and transferred from a WCF > service. > The client modifies the object, and transfers the object back to the > service where I create a new session and call SaveOrUpdateCopy(). The > problem I'm having is NHibernate is always generating an insert > statement instead of an update. The object has a primary key, and is > mapped properly (the data loads without a problem). > It appears that NHibernate thinks to the object is transient instead > of detached. > > Has anyone run across this problem? How can I ensure an object is > "detached" instead of "transient"? The session is per-call in the WCF > service so the session is not hanging around. > > Any help is greatly appreciated. > > -- > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > > -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
