Search   

Thursday, September 09, 2010

Support » Support Forum

Register  Login

 Menu  
 
    

 Welcome!  
 


Welcome to the NDO support forum!

kreis.gif Please register/login at the site if you want to post a thread. We sometimes copy support mails of common interest to the forum. They appear with anonymous sender.
kreis.gif Please post your messages in English language if possible. You can do your posts also in German, we will translate your post and our answer so that all users of the forum can read your posts.
kreis.gif The forum software requires that javascript is enabled.
kreis.gif Please do not insert licence information or licence keys in forum posts.
kreis.gif If you know a good answer to a post of another user, feel free to reply!
kreis.gif The forum is monitored. We reserve the right to remove posts we consider not to be useful for other forum users.

   Print   

      
 NDO Support Forum  
 
SearchForum Home
  NDO-Forum postings in english please, if possible.  Developing with NDO  Composite relat...
 Composite relations: parent not marked "dirty"
 
 10/19/2007 12:58:52 PM
schinmnu
4 posts


Composite relations: parent not marked "dirty"

Hi Mirko, I have the following problems:

A parent object that has a composite relation to a child object, isn't marked as "PersistentDirty" when the child object is changed.

This leads to another problem, that's even more annoying: if I call PersistenceManager.Restore(parent object) on an object whose child object got changed and where the parent object isn't marked as "PersistentDirty", the child object isn't restored at all. If the parent is marked as "PersistentDirty" because a property got changed, the child is restored correctly.

Would it be possible to implement the "PersistenceManager.Restore()" in a way, that all objects in composite relations are checked and - if necessary - get restored too?

I'll send you a test project as mail.

Best regards.

 10/22/2007 2:03:37 PM
Mirko
109 posts
5th


Re: Composite relations: parent not marked "dirty"

Hi Manuel,

NDO marks an object as PersistentDirty only, if the object has been changed. Each object marked as dirty is subject to a database update. That's why NDO doesn't mark a parent object as dirty, if you change a child object.

Iterating through a whole object tree during a call of Restore() might cause the load of thousands of objects depending on how big the object tree is. That's why NDO stops iterating at nodes which are not marked as PersistentDirty.

If you are sure, that all changes since the last call of Save() (or since the construction of the PersistenceManager) belong to one transaction you might use Abort() to restore all changed objects to their original state.

Otherwise you'd have to implement some kind of bookkeeping by yourself, which enables you to write object tree based compensators. If you need a sample of how to iterate throug an object tree in NDO, I'll send you a sample.

Best Regards
Mirko

  NDO-Forum postings in english please, if possible.  Developing with NDO  Composite relat...
  SearchSearch  Forum HomeForum Home