fix Issue #731 - position should stay the same after $em->flush()

fix + test
fixes #502 and closes #731