The problem is that in first case you have NO objects B and C. C doesn't exist at all, while B exist as uninitialized proxy - so when you reattach A in first case - nHibernate will just "initialize proxy for B" - and at the same moment create proxies for C and D objects - next step while processing A.B.C.Name expression is initializing C- proxy. D-proxy will remain uninitialized. Second call to A.B.D.E can't be completed without cascading reattachment, as only A object is reattached, but for initializing D- proxy B-object must be also attached to session. If we won't have B- object (B-initialized-proxy), but B-uninitialized-proxy - then nHibernate can initialize it and this will add this object to session - nHibernate doesn't "reinitialize" already initialized proxies...
BTW as I understand, your example may be simplified to just A->B->C chain - if in first step you'll attach A and ask for A.B.Name - and in second step try to attach A and get A.B.C.Name - without cascade or explicit B-object reattachment... --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
