PersistingEntityManager changes and test.