Dirty checking fails due to order of object reconstitution
- A blog post shall be shown
- The active Blog is queried and reconstituted
- During property thawing the posts inside the blog are reconstituted
- During that the posts clean state is memorized - but the Blog contained in the Post at that moment is not yet complete, it's posts property is still NULL.
- The Blog in the Post is cloned in this incomplete state
- Only after that the Blog receives it's Posts
Now, upon persisting the Post is checked for being dirty, and since the current Blog and the cloned Blog differ (the clone has NULL as posts), the whole shebang is persisted again. Which, obviously, is an utter waste of resources.
Now, go on and fix it. :)