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
        Hide
        Ivan Borzenkov added a comment -

        patch

        Show
        Ivan Borzenkov added a comment - patch
        Ivan Borzenkov made changes -
        Attachment DDC2112.patch [ 11341 ]
        Hide
        Ivan Borzenkov added a comment - - edited
        
        class Domain
        {
        ...
            /**
             * @ORM\OneToMany(targetEntity="Query", mappedBy="domain", cascade={"all"})
             */
            protected $q;
        ...
        }
        
        class Query
        {
        ...
            /**
             * @ORM\ManyToOne(targetEntity="Domain", inversedBy="q")
             */
            protected $domain;
        ...
        }
        

        if remove Domain - get mysql error foreign key

        Show
        Ivan Borzenkov added a comment - - edited class Domain { ... /** * @ORM\OneToMany(targetEntity= "Query" , mappedBy= "domain" , cascade={ "all" }) */ protected $q; ... } class Query { ... /** * @ORM\ManyToOne(targetEntity= "Domain" , inversedBy= "q" ) */ protected $domain; ... } if remove Domain - get mysql error foreign key
        Ivan Borzenkov made changes -
        Priority Critical [ 2 ] Minor [ 4 ]
        Ivan Borzenkov made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Invalid [ 6 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-2112, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

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

            Dates

            • Created:
              Updated:
              Resolved: