Firstly, my apologies for the HTML mail with a picture - I hope this doesn't cause too much offence, but I wasn't able to articulate the issue without resorting to graphics.
The picture below shows a simplified object graph that we're trying to update in a single transaction. Our handle onto the graph is a new (transient) instance of entity [C] - everything in the graph is new except for the [QB] entity which is existing. All collections are marked as cascade style all-delete-orphan, and the one-to-one association from [C] to [A] is marked as a save-update as is the many-to-one from [S] to [QB]. The association from [A] to [C] is not marked with any cascade annotation. When we attempt to persist this graph we get a transient object exception relating to [Q] at the point where NHibernate attempts to persist the new instance(s) of [P] because NHibernate has yet to traverse the [C] -> [A] association; if we omit the [P] -> [Q] link by setting the mapped property to null and temporarily permitting nulls then the DB operation is successful. Clearly, for this operation to succeed the new [Q] instances must be persisted prior to anything else because the top-level entities depend upon them. How can we ensure that this happens please? Thanks in advance, /Pete -- You received this message because you are subscribed to the Google Groups "nhusers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/nhusers?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
<<image001.png>>
