Doctrine PHPCR
  1. Doctrine PHPCR
  2. PHPCR-80

ChildrenCollection is not updated after flush although children where added before

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Labels:
      None

      Description

      If you create children of a document without adding them to the children collection of the parent (with a children annotation) the children collection is not updated after flush, you need to call $dm->clear() to force a reread of the children. The current case was with a parent and its children created in the same flush.

        Activity

        Uwe Jäger created issue -
        Hide
        Uwe Jäger added a comment -

        Try this code:

        $node1 = new Generic();
        $node1->setParent($parent);
        $node1->setNodename('source');
        $this->dm->persist($node1);

        $this->childrenNames = array('first', 'second', 'third', 'fourth');
        foreach ($this->childrenNames as $childName)

        { $child = new Generic(); $child->setNodename($childName); $child->setParent($node1); $this->dm->persist($child); }

        $this->dm->flush();
        $this->dm->clear();

        $node = $this->dm->find(null, '/functional/source');
        $children = $node->getChildren();

        // without the clear above $children === NULL, with the clear it works as expected

        Show
        Uwe Jäger added a comment - Try this code: $node1 = new Generic(); $node1->setParent($parent); $node1->setNodename('source'); $this->dm->persist($node1); $this->childrenNames = array('first', 'second', 'third', 'fourth'); foreach ($this->childrenNames as $childName) { $child = new Generic(); $child->setNodename($childName); $child->setParent($node1); $this->dm->persist($child); } $this->dm->flush(); $this->dm->clear(); $node = $this->dm->find(null, '/functional/source'); $children = $node->getChildren(); // without the clear above $children === NULL, with the clear it works as expected
        Hide
        David Buchmann added a comment -

        lukas, is this fixed with the work you did on cascading?

        Show
        David Buchmann added a comment - lukas, is this fixed with the work you did on cascading?
        Hide
        David Buchmann added a comment -

        we did a lot of refactoring on cascading lately. uwe, can you check if the problem still exists and do a pull request with a failing test if it exists?

        Show
        David Buchmann added a comment - we did a lot of refactoring on cascading lately. uwe, can you check if the problem still exists and do a pull request with a failing test if it exists?
        Hide
        David Buchmann added a comment -

        uwe, is this issue still relevant?

        Show
        David Buchmann added a comment - uwe, is this issue still relevant?
        David Buchmann made changes -
        Field Original Value New Value
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Cannot Reproduce [ 5 ]

        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=PHPCR-80, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Lukas Kahwe
            Reporter:
            Uwe Jäger
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: