You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cayenne.apache.org by Aristedes Maniatis <ar...@ish.com.au> on 2008/05/30 12:10:00 UTC

validation on one relation

We have Artist and Painting entities. Artist has validation code which  
is relatively slow to run (checks for duplicate Artists and some other  
things): maybe 0.5 seconds to execute.

When we add a new Painting record, it turns out that the Artist  
validation is fired, even though the Artist record in the database  
isn't touched in any way. Sure the relationship to paintings is  
philosophically altered by the addition of a new record, but should  
that be enough to fire validation? No actual change took place.

In our case, when we create 50,000 paintings in a batch (this artist  
has a team of low paid illustrators in his back shed), this slows  
things down a lot.

Is this behaviour:

[ ] expected & desirable
[ ] an option which could be disabled
[ ] unhelpful and should go away

For my part, it is a little annoying, although we could possibly  
accelerate the Artist validation by determining which attributes  
changed and only firing relevant validation.

Cheers
Ari



-------------------------->
ish
http://www.ish.com.au
Level 1, 30 Wilson Street Newtown 2042 Australia
phone +61 2 9550 5001   fax +61 2 9550 4001
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A