Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-3052

[GH-989] Fix the problem when the lifecycle event can be triggered more then once...

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      This issue is created automatically through a Github pull request on behalf of dyangrev:

      Url: https://github.com/doctrine/doctrine2/pull/989

      Message:

      We recently saw the postUpdate event get trigger multiple time incorrectly, it typically happens when flushing a set of entities persisted whose listener persist and flush another type of entity in it.

      Php passes variables to foreach by value, for the function executeUpdates in the UnitOfWork, for example, entities in the $this->entityUpdates could be updated and unset in the listener of the first entity, while them will be updated and trigger listeners again when the process of first entity finishes (although they have already been unset from $this->entityUpdates). Similar for executeInsertion and executeDeletion.

        Activity

        Hide
        Doctrine Bot added a comment -

        A related Github Pull-Request [GH-989] was closed:
        https://github.com/doctrine/doctrine2/pull/989

        Show
        Doctrine Bot added a comment - A related Github Pull-Request [GH-989] was closed: https://github.com/doctrine/doctrine2/pull/989

          People

          • Assignee:
            Marco Pivetta
            Reporter:
            Doctrine Bot
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: