CodeSmith Community
Your Code. Your Way. Faster!

Deepsave - Not observing inner relationships of children when deepsaving parent.

Latest post 07-19-2007 9:42 AM by Robert Hinojosa. 2 replies.
  • 07-05-2007 11:52 AM

    Deepsave - Not observing inner relationships of children when deepsaving parent.

    Let me try explain this one.

    I have a parent object (ParentObjectA) which has 3 child objects Named objA, objB, and objC

    objB and objC relate to objA in a parent child relationship.

    Now, a deepsave of  ParentObjectA (with the child types specified in the deepsave syntax) eventually calls the deepsave method in Data.Bases.ParentObjectAProviderBaseCore.

    I have found that whilst the saving of child objects is dealt with before saving the parent object, the relationship of those child objects is not observed. I.e. my code had a save for objB, then objC, then objA, - which failed as objB and objC are dependant on objA existing.

    Has anyone else observed this issue? Is this a bug? or will i have to go through all my deepsave methods in providerbasecore classes to ensure the correct order is kept.

    Regards,
    David
     

    </davidChristiansen> davidchristiansen.com
    • Post Points: 35
  • 07-19-2007 8:13 AM In reply to

    Re: Deepsave - Not observing inner relationships of children when deepsaving parent.

      Ping (Anyone got an answer?)

    </davidChristiansen> davidchristiansen.com
    • Post Points: 5
  • 07-19-2007 9:42 AM In reply to

    Re: Deepsave - Not observing inner relationships of children when deepsaving parent.

    Hi David,

    Any parent object, the ones that end with {0}Source, ex FkIdSource, will always be saved prior to the entity itself, and prior to its' children.

    Order of execution with DeepSave

    - Composite Parent Source objects
    - Root Entity
    - 1:1 relationships
    - m:n relationships
    - 1:m/m:1 relationships


     


    Robert Hinojosa
    -------------------------------------
    Member of the Codesmith Tools, .netTiers, teams
    http://www.nettiers.com
    -------------------------------------
    • Post Points: 5
Page 1 of 1 (3 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems