Best practice for commit order between Parent and child objects
Hello, I am not sure if I read this somewhere but wanted to know what is the best practice regarding commit order between Parent and child object. If we commit the parent first, then child will be autocommited? So should we always commit the child and then the parent or the other way around? Thanks!
The association is saved in the ‘parent’ entity (the place where the association starts from). To ensure data integrity, Mendix will auto-commit the ‘child’ object if it is not commited to the database already. Therefore you should model your app in such a way that auto-commits are not necessary. In practice this means making sure your ‘child' object is commited before you commit an association reference to it.