Thursday, September 09, 2010
Support » Support Forum
Register Login
HomeWhat is NDO?- Executive Overview- NDO for DevelopersHow NDO Works- Persistent Classes- Mapping- Queries- Reverse Engineering- Inheritance, Polymorphism- Distributed ApplicationsLicensingSupport- Support Forum- FAQ- Solutions- Downloads- E-Mail Support- Tutorial VideosOnline ShopContact
Welcome to the NDO support forum!
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. 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. The forum software requires that javascript is enabled. Please do not insert licence information or licence keys in forum posts. If you know a good answer to a post of another user, feel free to reply! The forum is monitored. We reserve the right to remove posts we consider not to be useful for other forum users.
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.
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 RegardsMirko