• Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0-BETA4
    • Fix Version/s: None
    • Component/s: ORM
    • Security Level: All
    • Labels:


      postPersist/postUpdate events are triggered in the middle of a unitOfWork, and querying the DB in such events causes infinite loops. Doctrine attempts to flush the entity manager before running any query, which triggers flushing of entities, and postPersist/postUpdate events are triggered again.

      I did not checked, but the flush() before each query may be a performance problem too, if doctrine has to determine what has changed, depending on the changetracking policy.

      Also, it would be great if postPersist / postUpdate events were triggered after all entities have been persisted. It looks like that entities are flushed by groups of same 'type', and that events for a type are triggered once all of the elements of that group have been flushed, potentially before entities of an other type have been flushed : postPersist / postUpdate events are triggered while some other entities are still not flushed.


        arnaud-lb created issue -
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Workflow jira [ 11874 ] jira-feedback [ 13875 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 13875 ] jira-feedback2 [ 15739 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 15739 ] jira-feedback3 [ 17996 ]


          • Assignee:
            Roman S. Borschel
          • Votes:
            0 Vote for this issue
            1 Start watching this issue


            • Created: