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

        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.
        Hide
        Rick Curtis added a comment -

        What version are you running on?

        Show
        Rick Curtis added a comment - What version are you running on?
        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.
        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.
        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.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development