Delete rules

From: Øyvind Harboe (oyvind.harbo..ylin.com)
Date: Sun Dec 03 2006 - 14:28:04 EST

  • Next message: Andrus Adamchik: "Re: Delete rules"

    I have discovered that I assumed that "Nullify" was default.

    Reading the wiki page below, I miss an explanation of why "No action"
    is default or why "No action" exists at all. I would have preferred
    some default that either "did what I expected" or forced me to
    consider this problem and solve it upfront(the obvious cost being that
    one is forced to learn another concept upfront).

    Can "No action" be overridden by subclassing to do something reasonable?

    What worries me is that "No action" is a bug waiting to happen. It
    certainly bit me(I've screwed this up in three Cayenne projects before
    I learned of the the default delete rule). The precise behavior of "No
    action" is somewhat random.

    - Delete + commit => relationship might exists depending on how many
    objects are cached in Cayenne.
    - Delete + commit + logout(create new DataContext) => relationship no
    longer exists(same as above w/"Nullify")

    http://cwiki.apache.org/confluence/display/CAYDOC/Delete+Rules

    I was also somewhat surprised that validateForDelete() does not take
    the deleteRule="Deny" into account and that the exception only occurs
    when deleteObject() is invoked.

    -- 
    Øyvind Harboe
    http://www.zylin.com
    



    This archive was generated by hypermail 2.0.0 : Sun Dec 03 2006 - 14:28:43 EST