OpenJPA
  1. OpenJPA
  2. OPENJPA-1974

StackOverflowError when performing multiple subquery in collection field with eager fetch

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.0, 2.2.0
    • Fix Version/s: 2.2.0
    • Component/s: jdbc
    • Labels:
      None
    • Environment:
      Windows, x86, JDK 1.6.0_22

      Description

      When I run a JPQL with multiple subquery in @OneToMany annotated collection property with eager fetch configuration, StackOverflowError is thrown.

      java.lang.StackOverflowError
      at org.apache.openjpa.jdbc.sql.SelectImpl.aliasSize(SelectImpl.java:2166)
      at org.apache.openjpa.jdbc.sql.SelectImpl.aliasSize(SelectImpl.java:2160)
      at org.apache.openjpa.jdbc.sql.SelectImpl.aliasSize(SelectImpl.java:2168)
      at org.apache.openjpa.jdbc.sql.SelectImpl.aliasSize(SelectImpl.java:2160)
      at org.apache.openjpa.jdbc.sql.SelectImpl.aliasSize(SelectImpl.java:2168)
      at org.apache.openjpa.jdbc.sql.SelectImpl.aliasSize(SelectImpl.java:2160)
      at org.apache.openjpa.jdbc.sql.SelectImpl.aliasSize(SelectImpl.java:2168)
      ...

      1. OPENJPA-1974.trunk.patch
        5 kB
        Rick Curtis
      2. subQueryBug.zip
        16 kB
        Takeshi Nishizawa

        Activity

        Takeshi Nishizawa created issue -
        Hide
        Takeshi Nishizawa added a comment -

        Attached a test case which reproduces the issue.

        Show
        Takeshi Nishizawa added a comment - Attached a test case which reproduces the issue.
        Takeshi Nishizawa made changes -
        Field Original Value New Value
        Attachment subQueryBug.zip [ 12475345 ]
        Hide
        Rick Curtis added a comment -

        What version are you running on?

        Show
        Rick Curtis added a comment - What version are you running on?
        Rick Curtis made changes -
        Assignee Rick Curtis [ curtisr7 ]
        Rick Curtis made changes -
        Fix Version/s 2.2.0 [ 12315910 ]
        Affects Version/s 2.1.0 [ 12314542 ]
        Affects Version/s 2.2.0 [ 12315910 ]
        Component/s jdbc [ 12311300 ]
        Hide
        Rick Curtis added a comment -

        Uploading a test case and test fix. All unit tests pass, but I want to sit on this change over night...

        I'm uncertain of whether or not a call to org.apache.openjpa.jdbc.sql.SelectImpl.aliasSize() can/will originate from a non "parent" SelectImpl. This is important to my change as to calculate the number of aliases I'm only looking at the SelectImpl object which aliasSize() was called and all of it's sub selects.

        Show
        Rick Curtis added a comment - Uploading a test case and test fix. All unit tests pass, but I want to sit on this change over night... I'm uncertain of whether or not a call to org.apache.openjpa.jdbc.sql.SelectImpl.aliasSize() can/will originate from a non "parent" SelectImpl. This is important to my change as to calculate the number of aliases I'm only looking at the SelectImpl object which aliasSize() was called and all of it's sub selects.
        Rick Curtis made changes -
        Attachment OPENJPA-1974.trunk.patch [ 12475433 ]
        Hide
        Rick Curtis added a comment -

        Committed test / fix to trunk.

        I ended up taking the SelectImpl.aliasSize( ... ) implementation from 1.2.x which was incorrectly refactored in the 2.0.x time.

        Show
        Rick Curtis added a comment - Committed test / fix to trunk. I ended up taking the SelectImpl.aliasSize( ... ) implementation from 1.2.x which was incorrectly refactored in the 2.0.x time.
        Hide
        Rick Curtis added a comment -

        Thanks for reporting the bug and uploading a testcase.

        Show
        Rick Curtis added a comment - Thanks for reporting the bug and uploading a testcase.
        Rick Curtis made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Albert Lee added a comment -

        Close issue in preparation for 2.2.0 release.

        Show
        Albert Lee added a comment - Close issue in preparation for 2.2.0 release.
        Albert Lee made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Rick Curtis
            Reporter:
            Takeshi Nishizawa
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development