geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbrenck <Dirk.Brenckm...@gmx.de>
Subject @Version and Query using version column cause trouble?
Date Sun, 23 Nov 2008 01:35:14 GMT

geronimo version 2.1.2

Any idea why the following query fails?

Serverside:

 pu for xxxx classes  TRACE  [ejbd 10] openjpa.Query - Executing query:
[SELECT entity FROM TypeEntity entity WHERE ( entity.id = :id ) AND (
entity.version = ( SELECT MAX( sameentity.version ) FROM TypeEntity
sameentity WHERE sameentity.id = :id ))] with parameters: {id=1011}

Clientside:

javax.ejb.EJBException: The bean encountered a non-application exception.;
nested exception is:
        <openjpa-1.0.2-r420667:627158 nonfatal user error>
org.apache.openjpa.persistence.ArgumentException: 0
        at
org.apache.openejb.client.EJBInvocationHandler.convertException(EJBInvocationHandler.java:219)
        at
org.apache.openejb.client.EJBObjectHandler._invoke(EJBObjectHandler.java:157)
        at
org.apache.openejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:117)
        at
org.apache.openejb.client.proxy.Jdk13InvocationHandler.invoke(Jdk13InvocationHandler.java:52)
        at $Proxy0.findEntityById(Unknown Source)
        at
org.brenckmann.java.prj.ejbclient.Client.listTypes(Client.java:123)
        at org.brenckmann.java.prj.ejbclient.Client.main(Client.java:50)
Caused by: <openjpa-1.0.2-r420667:627158 nonfatal user error>
org.apache.openjpa.persistence.ArgumentException: 0
        at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:851)
        at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:773)
        at
org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:525)
        at
org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:237)
        at
org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:277)
        at
org.brenckmann.java.ejb.core.AbstractEntitiesBean.findEntityById(AbstractEntitiesBean.java:115)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)


Column 'id' and 'version' are primary-key columns (and getter methods are
tagged @Id)
If I remove @Version from getVersion() everything is fine. Is it forbidden
to use a column tagged @Version in a Query?

Btw.: This thing fails when calling query.getSingleResult() it fails too
using query.getResultList() which is AbstractEntitiesBean.java:115


-- 
View this message in context: http://www.nabble.com/%40Version-and-Query-using-version-column-cause-trouble--tp20642421s134p20642421.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Mime
View raw message