Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 99515 invoked from network); 22 Nov 2007 18:59:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Nov 2007 18:59:07 -0000 Received: (qmail 83774 invoked by uid 500); 22 Nov 2007 18:58:53 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 83740 invoked by uid 500); 22 Nov 2007 18:58:53 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 83729 invoked by uid 99); 22 Nov 2007 18:58:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Nov 2007 10:58:53 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of eljotpl@gmail.com designates 64.233.170.185 as permitted sender) Received: from [64.233.170.185] (HELO rn-out-0102.google.com) (64.233.170.185) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Nov 2007 18:58:40 +0000 Received: by rn-out-0102.google.com with SMTP id s42so1765663rnb for ; Thu, 22 Nov 2007 10:58:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:reply-to:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=TMGdg+x0Xn92Ndz4D+QQSl6iQdurbMyzgxlRIac/0s4=; b=qh3V+tyMXt132G4xmHtR/VoA57/FLKglAhiD/iVacMB1Xor1HZ2eHiTowSUjL4eM/ybx3h3+AHks3whPvqFT12ywfUjU454Jh+L/TaQsYbtwdw56OE+vN0S2gaPkEySawD8Cu11xZodj0/5PLS3bmrbhrc0TwN1YHti6ZgIz5aA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:reply-to:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=Lq6jdFF6aX4/7cLxl07rJNDCDN58pywLT5TZ95ey4rNPQobdd/aBalBKg8N9aOB+p6ul8OukIJbgDIkAIJ5iZGDAb4Cso8r3+S+V8P6VK/0Xc0gBlbY+SCul8X85KwC9vW1H0rwDx1cc/6l1fDbioW08/xbfuHyQTcbLjGm1B1I= Received: by 10.151.12.1 with SMTP id p1mr1757435ybi.1195757913813; Thu, 22 Nov 2007 10:58:33 -0800 (PST) Received: by 10.35.39.9 with HTTP; Thu, 22 Nov 2007 10:58:33 -0800 (PST) Message-ID: <1b5bfeb50711221058g29f1aceblc5fb48049c8fe92f@mail.gmail.com> Date: Thu, 22 Nov 2007 19:58:33 +0100 From: "Jacek Laskowski" Reply-To: jacek@laskowski.net.pl Sender: eljotpl@gmail.com To: user@geronimo.apache.org Subject: Re: EntityExistsException: Attempt to persist detached object In-Reply-To: <13901667.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <13897173.post@talk.nabble.com> <1b5bfeb50711221042q450732d3n5b97cf1d83c6e2e5@mail.gmail.com> <13901667.post@talk.nabble.com> X-Google-Sender-Auth: 1d5bad9598f5e447 X-Virus-Checked: Checked by ClamAV on apache.org On Nov 22, 2007 7:52 PM, maho77 wrote: > 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. I need to try it out myself too as it could be an issue with our integration with openjpa. Anyway, don't touch primary key of the entity as it's reserved for a jpa provider's use. Let the default initial value be set for it. Jacek -- Jacek Laskowski http://www.JacekLaskowski.pl