[hibernate-issues] [Hibernate-JIRA] Created: (HHH-6892) persist() prior to getTransaction().begin() fails when using orphanRemoval = true

George Armhold (JIRA) noreply at atlassian.com
Tue Dec 13 23:11:21 EST 2011


persist() prior to getTransaction().begin() fails when using orphanRemoval = true
---------------------------------------------------------------------------------

                 Key: HHH-6892
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6892
             Project: Hibernate Core
          Issue Type: Bug
          Components: core
    Affects Versions: 3.6.8
         Environment: Hibernate 3.6.8.Final
Mac OSX Lion
JDK 1.6.0_29
H2 and MySQL

            Reporter: George Armhold
         Attachments: hibernate-bug.tar.gz

I have a Sport entity referencing a @OneToMany list of Players, specifying orphanRemoval = true.

The following sequence fails with "Don't change the reference to a collection with cascade=all-delete-orphan":

        em.persist(sport);
        em.getTransaction().begin();
        em.flush();
        em.getTransaction().commit();

while this works just fine:

        em.getTransaction().begin();
        em.persist(sport);
        em.flush();
        em.getTransaction().commit();

I have attached a JUnit testcase.


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list