… event args
…nt, because preRemove is executed too early
…s the persistence of positions after removal
…#1209 Added an unit test for issue #1209 and moved the persistance of position relocations from onFlush event, which is called before database transaction started, to the first call of postPersist, preUpdate or preRemove. So that the update query is executed within the transaction and if errors happen during queries the position changes will be rolled back. The synchronization of the objects has been separated from the database persistance, so that it will happen only if all queries were successfully executed.
The Closure strategy and the translatable listener are inserting the data in SQL without providing the identifier, assuming it is generated by the database. However, the default id strategy for Doctrine is 'AUTO', which chooses the strategy depending on the platform. When the sequence strategy is preferred (PostgreSQL and Oracle), these listeners were broken. Forcing the strategy to IDENTITY rather than AUTO fixes it.