[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-2373) Merging a persistent object leads to cascading failure in collections

Emmanuel Bernard (JIRA) noreply at atlassian.com
Fri Feb 16 00:07:40 EST 2007


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2373?page=all ]

Emmanuel Bernard updated HHH-2373:
----------------------------------

    Fix Version: 3.2.3

> Merging a persistent object leads to cascading failure in collections
> ---------------------------------------------------------------------
>
>          Key: HHH-2373
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2373
>      Project: Hibernate3
>         Type: Bug

>   Components: core
>     Versions: 3.2.1
>     Reporter: Emmanuel Bernard
>      Fix For: 3.2.3

>
>
> class Empire {
>    ...
>    @OneToMany(cascade.ALL)
>    public Set<Colony> colonies;
> }
> Then 
> roman = (Empire) em.get( Empire.class, roman.getId() );
> Colony gaule = new Colony();
> roman.getColonies().add(gaule);
> em.merge( roman ); //If commented, will work
> em.flush();
> em.clear();
> roman =(Empire) em.get(Empire.class, roman.getId() );
> assertEquals( 1, roman.getColonies().size() );
> I believe the issue is about having a persistent copy of gaule (according to the merge API), not part of roman.getColonies() (colonies containing the transient gaule object)

-- 
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