Parent/Child Insert ordering (was: Caching problem?)

From: Jeff de Vries (jdevrie..frog.com)
Date: Fri May 19 2006 - 21:38:53 EDT

  • Next message: Marcin Skladaniec: "Re: Caching problem?"

    I don't know if it is related or not, but I've also had problems in the
    past when I try to create a new parent and several child objects related
    to that parent all at once and then try to commit. The problem looks
    like Cayenne is INSERTing the child records into the database first,
    before the parent record, and the database complains that the children
    have an invalid foreign key (and, yes, I have the ON UPDATE and ON
    DELETE rules for the foreign key set to DO NOTHING and I still get the
    error from PostgreSQL). To get around it I just committed the parent
    first, then committed all the children.

    Thanks,
    Jeff



    This archive was generated by hypermail 2.0.0 : Fri May 19 2006 - 21:39:26 EDT