Return-Path: X-Original-To: apmail-openjpa-users-archive@minotaur.apache.org Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0EE5AD7FD for ; Thu, 16 May 2013 07:42:46 +0000 (UTC) Received: (qmail 79571 invoked by uid 500); 16 May 2013 07:42:45 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 78365 invoked by uid 500); 16 May 2013 07:42:38 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 78296 invoked by uid 99); 16 May 2013 07:42:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 May 2013 07:42:35 +0000 X-ASF-Spam-Status: No, hits=1.3 required=5.0 tests=URI_HEX X-Spam-Check-By: apache.org Received-SPF: error (athena.apache.org: local policy) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 May 2013 07:42:31 +0000 Received: from jim.nabble.com ([192.168.236.80]) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1Ucsov-000238-78 for users@openjpa.apache.org; Thu, 16 May 2013 00:41:49 -0700 Date: Thu, 16 May 2013 00:41:49 -0700 (PDT) From: Guillaume Chauvet To: users@openjpa.apache.org Message-ID: <1368690109188-7583923.post@n2.nabble.com> In-Reply-To: References: <1368636663892-7583921.post@n2.nabble.com> Subject: Re: Persist detached entities into a memory database MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hello, If I use "persist" operation, OpenJPA throws : org.apache.openjpa.persistence.EntityExistsException: Attempt to persist detached object "xxxx.xxxxx.xxxx.InternalUser@26f50154". If this is a new instance, make sure any version and/or auto-generated primary key fields are null/default when persisting. FailedObject: xxxx.xxxxx.xxxx.InternalUser@26f50154 If I use "merge" operation, OpenJPA throws : org.apache.openjpa.persistence.OptimisticLockException: Attempted to attach deleted instance type "class xxxx.xxxxx.xxxx.InternalUser" with oid "1359392486037000524". If the instance is new, the version field should be left to its default value. FailedObject: xxxx.xxxxx.xxxx.InternalUser@165f5a4 Regards, -- View this message in context: http://openjpa.208410.n2.nabble.com/Persist-detached-entities-into-a-memory-database-tp7583921p7583923.html Sent from the OpenJPA Users mailing list archive at Nabble.com.