Return-Path: X-Original-To: apmail-openjpa-dev-archive@www.apache.org Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E03941020F for ; Fri, 19 Apr 2013 00:07:16 +0000 (UTC) Received: (qmail 10811 invoked by uid 500); 19 Apr 2013 00:07:16 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 10779 invoked by uid 500); 19 Apr 2013 00:07:16 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 10769 invoked by uid 99); 19 Apr 2013 00:07:16 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Apr 2013 00:07:16 +0000 Date: Fri, 19 Apr 2013 00:07:16 +0000 (UTC) From: "Pinaki Poddar (JIRA)" To: dev@openjpa.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (OPENJPA-2373) MapsId in a Child entity to a Parent entity using auto-assigned identity fails with duplicte INSERT SQL MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Pinaki Poddar created OPENJPA-2373: -------------------------------------- Summary: MapsId in a Child entity to a Parent entity using auto-assigned identity fails with duplicte INSERT SQL Key: OPENJPA-2373 URL: https://issues.apache.org/jira/browse/OPENJPA-2373 Project: OpenJPA Issue Type: Bug Affects Versions: 2.2.1, 2.1.1, 2.0.1, 2.0.0 Reporter: Pinaki Poddar Assignee: Pinaki Poddar Fix For: 2.3.0 A MapsId annotation in entity C (child) annotates a field p of type P (parent). P uses auto-generated identity. P-C is a bidirectional parent-child relationship. During flush sequence, A row is created for P and flushed for the database to assign an identity. When C is flushed, it wrongly creates a row for P again while handling the field p that points to parent. Of course, the commit breaks with a DuplicateKeyException on P's table. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira