openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From José Luis Cetina <maxtorz...@gmail.com>
Subject InvalidStateException
Date Mon, 11 Mar 2013 19:23:32 GMT
Hi, i have problems trying to use merge method.

I have this scenerio.

1. My Managedbean get a list of Object  (MyClass) those objects are in the
database, the ejb use a Criteria to get all records.

2. The managedbean change some property (like description) in one of the
detached entities (that i get from the list).

3. The managedbean call a EJB and in the EJB i try to use merge for update
propuses. Then i get this exception:
 org.apache.openjpa.persistence.InvalidStateException: Primary key field
com.test.MyClass.id of com.test.MyClass.id 652eb3bd has non-default value.
The instance life cycle is in PNewState state and hence an existing
non-default value for the identity field is not permitted. You either need
to
remove the @GeneratedValue annotation or modify the code to remove the
initializer processing.

I dont know why this error is happens, the id of the object is the same id
that i get when i do the query in the EJB, that id, never changes.

Anyone has any idea, what im doing wrong??

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message