This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 301905 - JPQL Query in Many-to-Many Relationship produces StackOverflowError
Summary: JPQL Query in Many-to-Many Relationship produces StackOverflowError
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P2 major (vote)
Target Milestone: ---   Edit
Assignee: James Sutherland CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 304512
Blocks:
  Show dependency tree
 
Reported: 2010-02-04 19:33 EST by Bernard Missing name CLA
Modified: 2022-06-09 10:03 EDT (History)
3 users (show)

See Also:


Attachments
netbeans testcase in zip file (13.98 KB, application/octet-stream)
2010-02-04 19:36 EST, Bernard Missing name CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bernard Missing name CLA 2010-02-04 19:33:52 EST
Build Identifier: version: Eclipse Persistence Services - 2.0.0.v20091127-r5931

The crashing query of a @ManyToMany relationship is written in the most basic and compact way as follows:

select
     object(emp)
from
    Employee emp
where
    :projectId in(
        select
            proj.id
        from
            in(emp.projects) proj
    )


Reproducible: Always

Steps to Reproduce:
Please refer to the attached testcase (NetBeans project).
Comment 1 Bernard Missing name CLA 2010-02-04 19:36:26 EST
Created attachment 158249 [details]
netbeans testcase in zip file
Comment 2 Tom Ware CLA 2010-02-08 10:41:09 EST
Does the following JPQL allow you to workaround?


select Object(emp) 
from Employee emp join emp.projects proj 
where proj.id = :projectId
Comment 3 Bernard Missing name CLA 2010-02-08 19:53:06 EST
Tom,
You are you joking :)
This is a testcase. I don't need any help solving THIS testcase :)
Comment 4 Tom Ware CLA 2010-02-11 09:52:33 EST
Setting target and priority.  See the following page for details of what this means:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines
Comment 5 Michael OBrien CLA 2010-08-05 16:38:36 EDT
>verify not related StackOverflowError in bug # 304512 (even though this is JPQL not Criteria)
Comment 6 James Sutherland CLA 2011-11-07 14:55:20 EST
Not sure when this was fixed, but it seems to work in 2.4.
(maybe Guy's subselect fix)

Verified with new test in complex JPQL test suite.
Comment 7 Eclipse Webmaster CLA 2022-06-09 10:03:20 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink