Hello: I have the same problem. I have two tables TParent/TChild where TChild is a dependent table, i.e.
TParent: id (PK) - identity field (I am using Sql Server 2008) name TChild ParentId (PK1) -> TParent.Id Index (PK2) ... The combination ParentId/Index is unique. When I save the entities: I have something like this: var parent = new TParent(); var child = new TChild(); child.Index = 1; child.Parent = parent; parent.Children.Add(child); child = new TChild(); child.Index = 2; child.Parent = parent; parent.Children.Add(child); Session.SaveOrUpdate(parent); When this runs, I get the warning: Unable to determine if ... with assigned identifier is transient or detached I run a sql trace and before NH executes the child inserts it executes select statements to see if the children are there. I am still using NH 3.1.0. I will upgrade to 3.3.1 soon, but I was curious why NH can't figure out that the children are new. Calling Session.Save(child) before saving the parent (and right after the child was added to the Children collection) doesn't seem to work because it fired the child inserts before the parent was created Thanks -- You received this message because you are subscribed to the Google Groups "nhusers" group. To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/ygu-KT2PgY4J. 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.
