hibernate/hibernate-ogm — pull request #316 by gunnarmorling (2014-04-24 09:46:27+00:00)
Title: OGM-503

This finally should make sure updates/removals to/from ordered embedded collections are applied correctly for MongoDB.

This change now re-writes the complete association in one go. Besides correctly updating the collection in MongoDB, this reduces the number of roundtrips to the datastore and also minimizes exposure of intermediate state of the collection during updates to other readers.

Note that the inconsistent persistent form didn't show up in the tests. To discover this kind of issue we'd need assertions based on the actual persistent from and not the entity representation (e.g. to count the number of elements within a given embedded collection). Do you guys think we should put efforts into this?