Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1607

Entity with eager loaded association is not found when association is null

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Invalid
    • Affects Version/s: 2.2-BETA2
    • Fix Version/s: None
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      Two entities: A and B

      A:
      id PRIMARY
      b NULLABLE

      B:
      id PRIMARY

      Situation: A.b is null and set to eager loading (with fetch="EAGER"), find(id) is called for object A

      Actual Behaviour: The record from A is not found (probably due to an INNER JOIN being used).

      Expected behaviour: Entity A is loaded with b set to null (like during lazy loading).

        Activity

        Hide
        Guilherme Blanco added a comment -

        Increasing priority

        Show
        Guilherme Blanco added a comment - Increasing priority
        Hide
        Guilherme Blanco added a comment -
        Show
        Guilherme Blanco added a comment - It seems to be associated with this commit: https://github.com/doctrine/doctrine2/commit/68663fac4b5619643b8a140d6bbe7031e4fa2ad5#comments
        Hide
        Guilherme Blanco added a comment -

        Since it's a crash between versions, I'm increasing priority and also marking as regression.

        Show
        Guilherme Blanco added a comment - Since it's a crash between versions, I'm increasing priority and also marking as regression.
        Hide
        Benjamin Eberlei added a comment -

        A blocker indeed, reschedulding RC1 release until this is fixed.

        Show
        Benjamin Eberlei added a comment - A blocker indeed, reschedulding RC1 release until this is fixed.
        Hide
        Benjamin Eberlei added a comment -

        Can you show us the mappings, specifically how you map A#b? Are you setting nullable=false on the join columns?

        You problem could be related to:

        https://github.com/doctrine/doctrine2/pull/180
        https://github.com/doctrine/doctrine2/pull/182/files

        Show
        Benjamin Eberlei added a comment - Can you show us the mappings, specifically how you map A#b? Are you setting nullable=false on the join columns? You problem could be related to: https://github.com/doctrine/doctrine2/pull/180 https://github.com/doctrine/doctrine2/pull/182/files
        Hide
        Guilherme Blanco added a comment -

        Hi,

        I was unable to reproduce your issue with the comments you made so far.
        Are you able to modify the attached test file into a failure state that represents your problem?

        It may be easier for us to track down your problem after that.

        Show
        Guilherme Blanco added a comment - Hi, I was unable to reproduce your issue with the comments you made so far. Are you able to modify the attached test file into a failure state that represents your problem? It may be easier for us to track down your problem after that.
        Hide
        Marcel Koonstra added a comment -

        Trying the test case on master, but can't seem to be able to reproduce the bug (same goes for the actual problem case)

        Maybe some code has changed allready? I will investigate further if I can reproduce the bug in master.

        Show
        Marcel Koonstra added a comment - Trying the test case on master, but can't seem to be able to reproduce the bug (same goes for the actual problem case) Maybe some code has changed allready? I will investigate further if I can reproduce the bug in master.
        Hide
        Benjamin Eberlei added a comment -

        Closing as invalid, please reopen if you can reproduce, but it seems this is fixed.

        Show
        Benjamin Eberlei added a comment - Closing as invalid, please reopen if you can reproduce, but it seems this is fixed.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Marcel Koonstra
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: