Re: Many-to-many bug?

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Mon Apr 07 2008 - 15:52:34 EDT

  • Next message: RandyZelezna..ol.com: "Problem w/ Cayenne with SQL Server."

    I'd say we should handle this better... Please file an improvement
    request. I think this can be fixed with reasonable effort.

    Thanks
    Andrus

    On Apr 7, 2008, at 10:04 PM, Scott Anderson wrote:

    > Hi all,
    >
    >
    >
    > I've got a many-to-many relationship. For one object, I'm trying to
    > clear all of the entries in the relational table, and then re-add them
    > BEFORE doing a commit. If I do this, Cayenne tries to do an INSERT and
    > then a DELETE, but this fails since the relational table has both
    > fields
    > as PKs. My application must handle the condition where no action is
    > actually required on the database end, but it doesn't seem like the
    > application logic should be responsible for database quirks.
    >
    >
    >
    > Is there a simple way to solve this? My temporary solution is to do a
    > commit after removing the relationships and before re-adding them.
    >
    >
    >
    > Thanks,
    >
    > Scott
    >



    This archive was generated by hypermail 2.0.0 : Mon Apr 07 2008 - 15:53:10 EDT