Modification of doctrine ORM 2.4.X to keep compatibility with Gedmo.
Fix the issue http://www.doctrine-project.org/jira/browse/DDC-2726 introduced by the used of an flush in the postPersist doctrine event.