geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maho77 <>
Subject Re: EntityExistsException: Attempt to persist detached object
Date Thu, 22 Nov 2007 18:52:28 GMT

Jacek Laskowski wrote:
> On Nov 22, 2007 3:12 PM, maho77 <> wrote:
> 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

Hi Jacek,
 I have already tried em.persist(em.merge(group)). It didn't work. I the
meantime I found out that the problem obviously lies in the @TableGenerator
thing. I removed it and set the id by hand and it worked fine. So I hope
your right. with the primary key.
So only to understand it right, do I have to set the 
private int id = 0; 
by hand or is the attribute in the @TableGenerator enough. I ask because I
tried it with private int id; which also refused to work. On monday I will
be back in the office and try it. 

View this message in context:
Sent from the Apache Geronimo - Users mailing list archive at

View raw message