Affects Version/s: 1.0.0BETA3
Fix Version/s: None
Environment:PHP 5.3.3, Mac OS X 10.6.6, MongoDB 1.8.0
I'm using the latest version of Doctrine ODM (fresh from Git).
I have three levels of Documents (Two embedded); Category -> EmbedsMany: Post -> EmbedsMany PostVersion.
1. Make a new Post (Post1), 2 PostVersions (PostVersion1 and 2) and a Category
2. Add Post1 to Category
3. Persist Category, Flush, Clear
4. Retrieve Category
5. Make a new Post (Post2) and 2 PostVersions(PostVersion3 and 4)
6. Add Post2 to Category
If you're following properly, at this stage in the database there should be:
4 PostVersions ... 2 PostVersions in each Post
However, what actually happens is:
4 PostVersions ... 4 PostVersions in Post1, 0 PostVersions in Post2
A work around is to make Post2 and add it to Category, flush, then make new PostVersions and flush again.
I did some debugging but I don't know enough about the internals to fix the issue.