Sync relationship on hashes when commit.

This fixes rollback problems with relationships.