Re: New objects break FK constraints

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Jan 29 2004 - 11:29:18 EST

  • Next message: Andrus Adamchik: "Re: equivalent of DbAttribute.isMandatory() for Relationship?"

    Ordering of operations has been around for a while and proved to be
    very stable. I am fairly sure there is something with the mapping of
    the relationship (DB constraints and Cayenne mapping do not match). Is
    this the case described here:
    http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-41

    Andrus

    On Jan 29, 2004, at 11:24 AM, Jim Menard wrote:

    > I have two objects, BillAccount and Member. Member has a FK to
    > BillAccount. When I create both objects and try to commit them, I see
    > a foreign key constraint violation. It's because Cayenne is trying to
    > save the Member first, then the BillAccount. (BillAccount has no FK
    > back to member.)
    >
    > There are a few other objects involved; I'm going to write a test that
    > just tries to create these two.
    >
    > I thought Cayenne was supposed to save the BillAccount first for this
    > very reason. Am I doing something wrong? What can I do, aside from
    > remove the FK constraints from the database?
    >
    > Should I submit a bug report?
    >
    > Jim
    > --
    > Jim Menard, jim..o.com, http://www.io.com/~jimm/
    > "You guys have made me the happiest giant talking worm in the world."
    > -- Earthworm Jim



    This archive was generated by hypermail 2.0.0 : Thu Jan 29 2004 - 11:29:26 EST