Moved all doctrine flush operations to only happen on DoctrineFactory destruct