geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacek Laskowski" <ja...@laskowski.net.pl>
Subject Re: EntityExistsException: Attempt to persist detached object
Date Thu, 22 Nov 2007 18:42:18 GMT
On Nov 22, 2007 3:12 PM, maho77 <m.hoffmann@mvolution.de> wrote:

> 14:53:06,841 ERROR [LoginAdminImpl] Fehler beim Speichern der MTIGroup
> <openjpa-1.0.0-r420667:568756 nonfatal store error>
> org.apache.openjpa.persistence.EntityExistsException: Attempt to persist
> detached object "entities.MTIGroup@61a661a6".
> FailedObject: entities.MTIGroup@61a661a6
....
> @Entity
> @Table(name="group_table")
> public class MTIGroup implements Serializable, IMTIGroup {
>
>         private int id = -1;

It's a guess - shot in the dark, but worth to try out - why do you
assign -1 to the entity primary key? 0 is the default value so
everything that's different than the default value is likely
considered as a valid persistent identifier.

You may eventually want to run the sample with em.persist(em.merge(group)).

Jacek

-- 
Jacek Laskowski
http://www.JacekLaskowski.pl

Mime
View raw message