Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » stack overflow with subquery
stack overflow with subquery [message #512123] Thu, 04 February 2010 02:05 Go to next message
Tim Daley is currently offline Tim Daley
Messages: 6
Registered: July 2009
Junior Member
I'm getting the following stack overflow on a createEntityManager call:

[EL Info]: 2010-02-03 20:45:30.567--ServerSession(23764234)--EclipseLink, version: Eclipse Persistence Services - 2.0.0.v20091127-r5931
Exception in thread "main" java.lang.StackOverflowError
at org.eclipse.persistence.internal.expressions.BaseExpression. getBuilder(BaseExpression.java:51)
at org.eclipse.persistence.internal.expressions.BaseExpression. getBuilder(BaseExpression.java:51)
at org.eclipse.persistence.internal.expressions.ParameterExpres sion.getBuilder(ParameterExpression.java:138)
at org.eclipse.persistence.internal.expressions.BaseExpression. getBuilder(BaseExpression.java:51)
at org.eclipse.persistence.internal.expressions.BaseExpression. getBuilder(BaseExpression.java:51)
at org.eclipse.persistence.internal.expressions.ParameterExpres sion.getBuilder(ParameterExpression.java:138)
at org.eclipse.persistence.internal.expressions.BaseExpression. getBuilder(BaseExpression.java:51)
at org.eclipse.persistence.internal.expressions.BaseExpression. getBuilder(BaseExpression.java:51)
at org.eclipse.persistence.internal.expressions.ParameterExpres sion.getBuilder(ParameterExpression.java:138)
at org.eclipse.persistence.internal.expressions.BaseExpression. getBuilder(BaseExpression.java:51)
at org.eclipse.persistence.internal.expressions.BaseExpression. getBuilder(BaseExpression.java:51)
at org.eclipse.persistence.internal.expressions.ParameterExpres sion.getBuilder(ParameterExpression.java:138)
at org.eclipse.persistence.internal.expressions.BaseExpression. getBuilder(BaseExpression.java:51)
at org.eclipse.persistence.internal.expressions.BaseExpression. getBuilder(BaseExpression.java:51)
at org.eclipse.persistence.internal.expressions.ParameterExpres sion.getBuilder(ParameterExpression.java:138)
at org.eclipse.persistence.internal.expressions.BaseExpression. getBuilder(BaseExpression.java:51)
at org.eclipse.persistence.internal.expressions.BaseExpression. getBuilder(BaseExpression.java:51)
at org.eclipse.persistence.internal.expressions.ParameterExpres sion.getBuilder(ParameterExpression.java:138)
at org.eclipse.persistence.internal.expressions.BaseExpression. getBuilder(BaseExpression.java:51)

The definition that's causing it is:

<named-query name="findCountryFromAlias">
<query>
<![CDATA[
SELECT co
FROM Country co
WHERE LOWER(:name) = LOWER(co.abbrev)
or LOWER(:name) = LOWER(co.name)
or LOWER(:name) IN (SELECT coa.alias FROM CountryAlias coa WHERE LOWER(:name) = LOWER(coa.name))
]]>
</query>
</named-query>
Re: stack overflow with subquery [message #512243 is a reply to message #512123] Thu, 04 February 2010 13:46 Go to previous message
Chris Delahunt is currently offline Chris Delahunt
Messages: 1026
Registered: July 2009
Senior Member
Please feel free to file a bug detailing the mappings that lead to this, as it appears to be a problem in building the expressionBuilders from the query.

I'm sure if this was intended, but the query itself doesn't appear valid -
"LOWER(:name) IN (SELECT coa.alias FROM CountryAlias coa WHERE LOWER(:name) = LOWER(coa.name))"
does not tie to the Country object in anyway. So if there exists a coa.alias that equals coa.name and equals the parameter passed in, it will cause all Country objects to be returned. ie it is either always true or always false for a query.

Best Regards,
Chris
Previous Topic:ConcurrentModificationException prior to updating entity.
Next Topic:Query for boolean
Goto Forum:
  


Current Time: Thu Oct 02 00:30:10 GMT 2014

Powered by FUDForum. Page generated in 0.01834 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software