openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhourui <zhou...@zoneland.net>
Subject group by error with empty table.
Date Wed, 17 Jun 2015 05:35:31 GMT
with the apache-openjpa-2.4.1-20150608.073929-5-binary.zip

CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<Tuple> cq = cb.createQuery(Tuple.class);
Root<ReadCompleted> root = cq.from(ReadCompleted.class);
Predicate p = cb.equal(root.get(ReadCompleted_.person), person);
javax.persistence.criteria.Path<String> applicationNamePath =
root.get(ReadCompleted_.applicationName);
Expression<Long> countPath = cb.count(root);
cq.multiselect(countPath,
applicationNamePath).where(p).groupBy(applicationNamePath);

if the table of ReadCompleted is empty, it is error:

Caused by: com.ibm.db2.jcc.am.SqlException:
[jcc][t4][10120][10898][4.13.127] 操作无效:已关闭 result set。 ERRORCODE=-4470,
SQLSTATE=null
	at com.ibm.db2.jcc.am.id.a(id.java:661)
	at com.ibm.db2.jcc.am.id.a(id.java:60)
	at com.ibm.db2.jcc.am.id.a(id.java:103)
	at com.ibm.db2.jcc.am.bo.Db(bo.java:4599)
	at com.ibm.db2.jcc.am.bo.r(bo.java:4556)
	at com.ibm.db2.jcc.am.bo.f(bo.java:1399)
	at com.ibm.db2.jcc.am.bo.getObject(bo.java:1391)
	at
org.apache.commons.dbcp.DelegatingResultSet.getObject(DelegatingResultSet.java:325)
	at
org.apache.commons.dbcp.DelegatingResultSet.getObject(DelegatingResultSet.java:325)
	at
org.apache.openjpa.lib.jdbc.DelegatingResultSet.getObject(DelegatingResultSet.java:269)
	at
org.apache.openjpa.jdbc.sql.DBDictionary.getObject(DBDictionary.java:916)
	at
org.apache.openjpa.jdbc.sql.ResultSetResult.getObjectInternal(ResultSetResult.java:449)
	at
org.apache.openjpa.jdbc.sql.AbstractResult.getObject(AbstractResult.java:691)
	at org.apache.openjpa.jdbc.kernel.exps.UnaryOp.load(UnaryOp.java:120)
	at
org.apache.openjpa.jdbc.kernel.ProjectionResultObjectProvider.getResultObject(ProjectionResultObjectProvider.java:78)
	at
org.apache.openjpa.slice.jdbc.UniqueResultObjectProvider.next(UniqueResultObjectProvider.java:97)
	at
org.apache.openjpa.kernel.QueryImpl$PackingResultObjectProvider.next(QueryImpl.java:2085)
	at
org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:34)
	... 58 more
<openjpa-2.4.1-SNAPSHOT-r422266:1683401 fatal general error>
org.apache.openjpa.persistence.PersistenceException:
[jcc][t4][10120][10898][4.13.127] 操作无效:已关闭 result set。 ERRORCODE=-4470,
SQLSTATE=null
	at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:5001)
	at
org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4961)
	at
org.apache.openjpa.jdbc.sql.DB2Dictionary.newStoreException(DB2Dictionary.java:574)
	at
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:133)
	at
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:115)
	at
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:67)
	at
org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.handleCheckedException(SelectResultObjectProvider.java:154)
	at
org.apache.openjpa.slice.jdbc.UniqueResultObjectProvider.handleCheckedException(UniqueResultObjectProvider.java:76)
	at
org.apache.openjpa.kernel.QueryImpl$PackingResultObjectProvider.handleCheckedException(QueryImpl.java:2109)
	at
org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:39)
	at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1250)
	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1006)
	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:862)
	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:793)
	at
org.apache.openjpa.slice.DistributedQueryImpl.execute(DistributedQueryImpl.java:61)
	at
org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:541)
	at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:274)
	at
org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:290)
	at
com.x.processplatform.assemble.surface.task.jaxrs.task.TaskAction.countWithApplication(TaskAction.java:304)
	at
com.x.processplatform.assemble.surface.task.jaxrs.task.TaskAction.countWithApplication(TaskAction.java:142)
	at sun.reflect.GeneratedMethodAccessor89.invoke(Unknown Source)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at
org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
	at
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:164)
	at
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:181)
	at
org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:158)
	at
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:101)
	at
org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
	at
org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
	at
org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
	at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:305)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
	at
org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
	at
org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:288)
	at
org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1110)
	at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:401)
	at
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:386)
	at
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:335)
	at
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:222)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at
com.x.common.core.application.jaxrs.AbstractJaxrsFilter.doFilter(AbstractJaxrsFilter.java:32)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
	at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
	at
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
	at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
	at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
	at
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2463)
	at
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2452)
	at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)

if the table is not empty. it is work fine.



--
View this message in context: http://openjpa.208410.n2.nabble.com/group-by-error-with-empty-table-tp7588297.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message