do em.merge before em.flush