openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fernando (JIRA)" <>
Subject [jira] Created: (OPENJPA-799) slices: can not handle multiple projections in one query ( select count(*), max(fieldA) .......)
Date Mon, 01 Dec 2008 00:08:44 GMT
slices: can not handle multiple projections in one query ( select count(*), max(fieldA) .......)

                 Key: OPENJPA-799
             Project: OpenJPA
          Issue Type: Bug
          Components: kernel
    Affects Versions: 2.0.0
            Reporter: Fernando
            Priority: Critical

I got this exception while running my program, and eventually I figured out that the existing
UniqueResultObjectProvider that was doing the aggregation would loop through the result sets,
but would do it one per column.. (twice in my case), but it would not reset the resultsets
after each loop...

I will look at just writing it from scratch (calling it AggregatingResultObjectProvider, to
be closer to what it actually does ).  I'll submit a patch soon.

<openjpa-2.0.0-SNAPSHOT-r422266:721073M nonfatal user error> org.apache.openjpa.persistence.ArgumentException:
Failed to execute query "select count( this ), max( this.createTime ) from
this  where this.teamFan = :p0 AND this.createTime > :p1 AND this.createTime <= :p2
AND this.points > 0". Check the query syntax for correctness. See nested exception for
        at org.apache.openjpa.kernel.QueryImpl.execute(
        at org.apache.openjpa.kernel.QueryImpl.execute(
        at org.apache.openjpa.kernel.DelegatingQuery.execute(
        at org.apache.openjpa.persistence.QueryImpl.execute(
        at org.apache.openjpa.persistence.QueryImpl.getSingleResult(
        at com.protrade.common.persistence.JPAUtil.execute(
        at com.protrade.common.persistence.JPAUtil.executeUnique(
        at com.protrade.common.persistence.JPADQuery.uniqueResult(
        at com.protrade.common.persistence.BaseRootDAOBase.runUniqueQueryNCS(
        at com.protrade.common.persistence.BaseDAOBase.runUniqueQueryNCS(
        at com.protrade.common.spring.OpenEMFilter$
        at java.util.concurrent.Executors$
        at java.util.concurrent.FutureTask$Sync.innerRun(
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(
        at java.util.concurrent.ScheduledThreadPoolExecutor$
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
        at java.util.concurrent.ThreadPoolExecutor$
Caused by: java.sql.SQLException: After end of result set
        at com.mysql.jdbc.SQLError.createSQLException(
        at com.mysql.jdbc.SQLError.createSQLException(
        at com.mysql.jdbc.SQLError.createSQLException(
        at com.mysql.jdbc.ResultSetImpl.checkRowPos(
        at com.mysql.jdbc.ResultSetImpl.getObject(
        at org.apache.openjpa.lib.jdbc.DelegatingResultSet.getObject(
        at org.apache.openjpa.jdbc.sql.DBDictionary.getObject(
        at org.apache.openjpa.jdbc.sql.ResultSetResult.getObjectInternal(
        at org.apache.openjpa.jdbc.sql.AbstractResult.getObject(
        at org.apache.openjpa.jdbc.kernel.exps.UnaryOp.load(
        at org.apache.openjpa.jdbc.kernel.ProjectionResultObjectProvider.getResultObject(
        at org.apache.openjpa.kernel.QueryImpl.singleResult(
        at org.apache.openjpa.kernel.QueryImpl.toResult(
        at org.apache.openjpa.kernel.QueryImpl.execute(
        at org.apache.openjpa.kernel.QueryImpl.execute(
        ... 23 more

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message