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

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

    XMLWordPrintable

    Details

    • Affects:
      Release Notes
    • Workaround:
      Workaround Exists
    • Workaround Description:
      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
    • Release Notes Text:
      The cascade-save operation was incorrectly handling auto-incremented Primary Key (PK) tables that linked to parent tables with an assigned PK. The fix now allows the cascade-save operation to handle the parent-child relationship between tables.
    • Release Notes Docs Status:
      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

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  rrajesh Rajesh Rajasekaran
                  Reporter:
                  stliu Strong Liu
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: