Brendan, please... at least send the mapping... you may have circular
cascades and without see the mapping we are talking making unnecessary
suppositions.

2009/2/6 Brendan Erwin <[email protected]>

> Ok, but how does that cover cascading updates?
> I only call ISession.Save with the Parent. Assuming both the parent and
> children are new entities (the only case that causes the FK constraint
> error) NH is deciding on its own to insert the children prior to the parent.
>
> In other words, I think my entire issue is occurring in step 1 "all entity
> insertions".
>
> On Feb 6, 2009, at 4:10 PM, Fabio Maulo wrote:
>
> Or herehttp://nhforge.org/doc/nh/en/index.html#manipulatingdata-flushing
>
> Is the same section of NH2.0 reference.
>
> 2009/2/6 Ayende Rahien <[email protected]>
>
>> Because you told it to.
>>
>> See here:
>>
>> http://www.hibernate.org/hib_docs/nhibernate/1.2/reference/en/html/manipulatingdata.html
>>
>> Section 9.6
>>
>> The SQL statements are issued in the following order
>>
>>    1.
>>
>>    all entity insertions, in the same order the corresponding objects
>>    were saved using ISession.Save()
>>    2.
>>
>>    all entity updates
>>    3.
>>
>>    all collection deletions
>>    4.
>>
>>    all collection element deletions, updates and insertions
>>    5.
>>
>>    all collection insertions
>>    6.
>>
>>    all entity deletions, in the same order the corresponding objects were
>>    deleted using ISession.Delete()
>>
>>
>>
>> On Fri, Feb 6, 2009 at 11:03 PM, Brendan Erwin 
>> <[email protected]>wrote:
>>
>>> But I only call save once, NH is deciding to insert the Child entities on
>>> its own. (I'm using Cascade.)
>>> I need to find out why it decided to insert the children first.
>>>
>>> On Feb 6, 2009, at 2:43 PM, Ayende Rahien wrote:
>>>
>>> NH will INSERT in the same order that you called save.
>>>
>>> On Fri, Feb 6, 2009 at 8:18 PM, Brendan Erwin 
>>> <[email protected]>wrote:
>>>
>>>> Ayende: Yes, its saving the child before the parent, no, I'm not doing
>>>> it explicitly. (I'm calling SaveOrUpdateCopy on the aggregate root, the
>>>> Parent and Parent of Parents to the Child.)
>>>>
>>>> Tuna and Fabio: I can, but it'll be a bit... I'd need to extract and
>>>> simplify a lot. But really what I'm hoping for is a way to see what NH is
>>>> thinking, not so much for a solution to my particular immediate problem.
>>>>
>>>> I'm assuming that NH is deciding which entity to persist first based on
>>>> the relationships between them all. Is there an internal representation of
>>>> the decision tree it follows? Something I can look at that will help me to
>>>> sniff out what relationship in my mappings is causing it to decide this
>>>> particular path?
>>>>
>>>>
>>>> On Feb 6, 2009, at 12:59 PM, Fabio Maulo wrote:
>>>>
>>>> mapping + code between session open and session close
>>>>
>>>> 2009/2/6 brendanjerwin <[email protected]>
>>>>
>>>>>
>>>>> Disclaimer: I'm really green with this stuff, so please pardon my
>>>>> ignorance. Feel free to tell me to RTFM, but at least give me a link
>>>>> to the relevant sections since I haven't found it yet.
>>>>>
>>>>> Problem: NH is INSERTing an entity that is a child of another entity /
>>>>> before/ inserting the parent. This is resulting in a FK constraint
>>>>> error. (The database I'm working against is a legacy DB from hell, so
>>>>> I have to work with what I have. i.e. disabling the constraint isn't
>>>>> an option...) I realize I've probably told NH something wrong about
>>>>> the relationships of the parts but I can't find where. Is there a way
>>>>> I can see what NH thinks is going on so I can find my problem?
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Fabio Maulo
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>
>
> --
> Fabio Maulo
>
>
>
>
>
> >
>


-- 
Fabio Maulo

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to