8 Replies Latest reply on May 11, 2013 8:16 AM by User576183-Oracle

    Commit both parts of a "references" association together

      I'm running JDev

      I have an Entity Association between TABLE_A and TABLE_B Entities in a 0..1 -> * references relationship. I will either be creating just a record in TABLE_B or records in both TABLE_B and TABLE_B.

      When creating records in both Entities I want both records to form an atomic transaction; either commit both or rollback. The problem is that if I try to commit both at the same time, the child record won't insert because the parent PK has changed from the temporary negative number. If I set the Association to be a Composite Association, committing both records together works, but I am then unable to commit a single record in TABLE_B on it's own.

      What is the recommended solution for this situation?

      Many thanks