[hibernate-issues] [Hibernate-JIRA] Resolved: (HHH-1018) Duplicate insert in join table when calling session.flush() twice

Diego Pires Plentz (JIRA) noreply at atlassian.com
Sun Oct 14 02:38:40 EDT 2007


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1018?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Diego Pires Plentz resolved HHH-1018.
-------------------------------------

      Assignee: Diego Pires Plentz
    Resolution: Duplicate

> Duplicate insert in join table when calling session.flush() twice
> -----------------------------------------------------------------
>
>                 Key: HHH-1018
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1018
>             Project: Hibernate3
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.1 beta 2
>         Environment: MySQL 5.0.13, Hibernate 3.1 beta 3, jdk 1.5.0_05, ant 1.6.2
>            Reporter: Connor Barry
>            Assignee: Diego Pires Plentz
>         Attachments: HibernateJIRA.zip
>
>
> see http://forums.hibernate.org/viewtopic.php?t=948463&sid=a1a88b56a4e3062d5443e530e2c00ef4
> My problem is that when I run the above code, I call flush() twice. The second time I call flush(), it correctly generates an update() statement, but also tries to insert a second identical row in the join table activity_deals, which fails due to a non-unique-key problem.
> Why is Hibernate trying to insert the row twice? I've verified that after the first flush(), Activity and Deal are both persistent and have both been inserted into their respective tables, and join table.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list