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

HHH-3334 Cascade-save breaks if parent ID is assigned (delays insert) and child has identity ID (early insert)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • EAP_EWP 5.1.1
    • EAP_EWP 5.1.0_CR1, EAP_EWP 5.1.0_CR2, EAP_EWP 5.1.0_CR3, EAP_EWP 5.1.0
    • Hibernate
    • None
    • Release Notes
    • Workaround Exists
    • Hide

      do not use cascade and save the table with assigned PK first

      Show
      do not use cascade and save the table with assigned PK first
    • Hide
      The <classname>cascade-save</classname> operation was incorrectly handling auto-incremented Primary Key (PK) tables that linked to parent tables with an assigned PK. The fix now allows the <classname>cascade-save</classname> operation to handle the parent-child relationship between tables.
      Show
      The <classname>cascade-save</classname> operation was incorrectly handling auto-incremented Primary Key (PK) tables that linked to parent tables with an assigned PK. The fix now allows the <classname>cascade-save</classname> operation to handle the parent-child relationship between tables.
    • Documented as Resolved Issue

    Description

      Consider:

      a table with an assigned PK (i.e. not auto-increment), let's call this "A"
      Another table ("B") linked to the table listed above but with it's PK set to auto-increment.
      Now if you try to save B with cascading switched on, it will break. From the little debugging I've done it looks like:

      a) hibernate detects that A needs to be saved first, but puts it into some sort of queue.
      b) when it hits B, it short-circuits this save queue and tries to save B immediately so as to obtain a PK reference for B. This fails since A hasn't been yet been saved so it's link is still null.

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

      Attachments

        Issue Links

          Activity

            People

              shaozliu Strong Liu(刘少壮) (Inactive)
              shaozliu Strong Liu(刘少壮) (Inactive)
              Misty Stanley-Jones Misty Stanley-Jones (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: