Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Invalid
    • Affects Version/s: Git Master
    • Fix Version/s: None
    • Component/s: ORM
    • Labels:
      None

      Description

      cascadeRemove incorrect work

      UnitOfWork

      in commit() (336)

      // Entity deletions come last and need to be in reverse commit order
      if ($this->entityDeletions) {
      for ($count = count($commitOrder), $i = $count - 1; $i >= 0; --$i)

      { $this->executeDeletions($commitOrder[$i]); }

      }

      ----------------------------------------------------------------
      in doRemove (1630)

      // Cascade first, because scheduleForDelete() removes the entity from the identity map, which
      // can cause problems when a lazy proxy has to be initialized for the cascade operation.
      $this->cascadeRemove($entity, $visited);

      ......

      $this->scheduleForDelete($entity);

      in array we get

      child
      child
      parent

      revert in commit - first remove parent and get foregein key error

      if move cascadeRemove after switch all woork correct

        Activity

        Ivan Borzenkov created issue -
        Ivan Borzenkov made changes -
        Field Original Value New Value
        Description cascadeRemove incorrect work

        in commit

                    // Entity deletions come last and need to be in reverse commit order
                    if ($this->entityDeletions) {
                        for ($count = count($commitOrder), $i = $count - 1; $i >= 0; --$i) {
                            $this->executeDeletions($commitOrder[$i]);
                        }
                    }


        ----------------------------------------------------------------
        in doRemove

                // Cascade first, because scheduleForDelete() removes the entity from the identity map, which
                // can cause problems when a lazy proxy has to be initialized for the cascade operation.
                $this->cascadeRemove($entity, $visited);


        ......


                        $this->scheduleForDelete($entity);


        in array we get

        child
        child
        parent

        revert in commit - first remove parent and get foregein key error

        if move cascadeRemove after switch all woork correct
        cascadeRemove incorrect work

        UnitOfWork

        in commit() (336)

                    // Entity deletions come last and need to be in reverse commit order
                    if ($this->entityDeletions) {
                        for ($count = count($commitOrder), $i = $count - 1; $i >= 0; --$i) {
                            $this->executeDeletions($commitOrder[$i]);
                        }
                    }


        ----------------------------------------------------------------
        in doRemove (1630)

                // Cascade first, because scheduleForDelete() removes the entity from the identity map, which
                // can cause problems when a lazy proxy has to be initialized for the cascade operation.
                $this->cascadeRemove($entity, $visited);


        ......


                        $this->scheduleForDelete($entity);


        in array we get

        child
        child
        parent

        revert in commit - first remove parent and get foregein key error

        if move cascadeRemove after switch all woork correct
        Ivan Borzenkov made changes -
        Attachment DDC2112.patch [ 11341 ]
        Ivan Borzenkov made changes -
        Priority Critical [ 2 ] Minor [ 4 ]
        Ivan Borzenkov made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Invalid [ 6 ]

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Ivan Borzenkov
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: