Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-2278

HHH-5784 Save can fail when there is a transient entity reachable by multiple paths and at least one path does not cascade on save

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • None
    • EAP 5.0.0.CR1, EAP 5.0.0.BETA, EAP 5.0.0, EAP 5.0.1.CR1, EAP_EWP 5.1.0
    • Hibernate
    • None
    • Release Notes
    • Workaround Exists
    • Hide

      The simplest workaround is to save the transient entity before executing the save that is failing.

      A more complicated workaround is to modify cascade and/or entity mappings to change the order of the cascade paths so that the transient entity is saved before cascading to the entity that requires it to be non-transient.

      Show
      The simplest workaround is to save the transient entity before executing the save that is failing. A more complicated workaround is to modify cascade and/or entity mappings to change the order of the cascade paths so that the transient entity is saved before cascading to the entity that requires it to be non-transient.

      This issue is the same as JBPAPP-915, but is for the save event. It may also affect persist and save-update events.

      The fix should be very similar to what was done for JBPAPP-915 and one fix may work for all of these types of events.

      This issue needs to be fixed to support JDK 1.6. Because the iteration order for HashSets and HashMaps is different for JDK 1.6, cascading operations to entities in a set may be saved in a different order, causing a cascade that worked in a previous version to fail with a TransientObjectException.

      See http://opensource.atlassian.com/projects/hibernate/browse/HHH-3229 for details.

      In addition, a note should go into the release notes that the change in order of cascades is a known issue.

      http://opensource.atlassian.com/projects/hibernate/browse/HHH-5784

            shaozliu Strong Liu(刘少壮) (Inactive)
            gbadner@redhat.com Gail Badner (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: