openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OPENJPA-2373) MapsId in a Child entity to a Parent entity using auto-assigned identity fails with duplicte INSERT SQL
Date Sun, 19 May 2013 17:41:15 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-2373?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661607#comment-13661607
] 

ASF subversion and git services commented on OPENJPA-2373:
----------------------------------------------------------

Commit 1484320 from hthomann
[ https://svn.apache.org/r1484320 ]

OPENJPA-2373: MapsId in a Child entity to a Parent entity using auto-assigned identity fails
with duplicte INSERT SQL - back ported to 2.2.1.x Pinaki Poddar's trunk changes.
                
> 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.0.0, 2.0.1, 2.1.1, 2.2.1
>            Reporter: Pinaki Poddar
>            Assignee: Pinaki Poddar
>             Fix For: 2.3.0
>
>         Attachments: graycol.gif
>
>
> 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

Mime
View raw message