cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Øyvind Harboe" <>
Subject Delete rules
Date Sun, 03 Dec 2006 19:28:04 GMT
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")

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

View raw message