Delete cascade problem

From: Gili (cowwo..bs.darktech.org)
Date: Thu Sep 15 2005 - 17:48:06 EDT

  • Next message: Kurt Werle: "Re: Feedback regarding Cayenne vs Hibernate"

    Hi,

            I've got this relationship:

    On delete of A, cascade to B
    On delete of B, if any "A" instances exist, DENY

            What I'm seeing at runtime is that I delete A, it tries to cascade to B
    but this fails because A is still associated with it. Cayenne doesn't
    seem to be smart enough to notice this is ok because A is the one
    triggering the delete in the first place. Here are the logs I get at
    runtime (I added these to the code):

    INFO DataContextDeleteAction:279 -
    desktopbeautifier.server.cayenne.delegates.DefaultImag..d=14200 is
    cascading delete to
    desktopbeautifier.server.cayenne.delegates.DefaultContentTyp..d=6080

    INFO DataContextDeleteAction:279 -
    desktopbeautifier.server.cayenne.delegates.DefaultImag..d=14200 is
    cascading delete to
    desktopbeautifier.server.cayenne.delegates.ImageDat..d=14520

    org.objectstyle.cayenne.access.DeleteDenyException: Can't delete object
    with OID desktopbeautifier.server.cayenne.delegates.ImageData: <id:
    14520>. Reason: relationship 'image' has Deny. Details: Related objects:
    java.util.Collections$SingletonLis..d=14200

            I think I might try writing a unit test tomorrow. Please let me know if
    the above is the expected behavior or if this sounds like a bug.

    Thanks,
    Gili

    -- 
    http://www.desktopbeautifier.com/
    



    This archive was generated by hypermail 2.0.0 : Thu Sep 15 2005 - 17:48:06 EDT