Re: mysql rant

From: Andrus (andru..bjectstyle.org)
Date: Wed Jan 01 2003 - 20:58:15 EST

  • Next message: Craig Miskell: "Re: delete rules changes causes problems with Oracle"

    At 11:53 AM 1/2/2003 +1300, Craig Miskell wrote:
    ><rant-mode>Arrgghhhhhh..... unless mysql is *explicitly* compiled with
    >-DDONT_USE_DEFAULT_FIELDS (and I'm not keen on trying to compile said
    >beast on my windows box... yuck), any integer type fields declared as NON-NULL
    >will have a DEFAULT value of 0.... so if no value is supplied in the
    >insert statement (e.g. a foreign key field, say gallery_id in the exhibit
    >table in the unittests maybe.... ;-)), then a default value is inserted.
    >No, this is not considered an error by mysql, despite the data integrity
    >issues this most clearly raises. Unless you feel like recompiling it
    >yourself.

    Could you identify the place in the code where Cayenne relies on the
    implicit value (exhibit without a gallery?). Normally Cayenne should send
    "NULL" explicitly when required. Maybe before we dig deeper into validation
    etc., we should fix this and use NULL when building inserts/updates?

    >This was at least one of the problems that was thrown up with my recent
    >changes (I created an exhibit without a gallery). Maybe it's time we had
    >client-side validation against the DataMap at commit time... configurable
    >on or off in case the end-developer wishes to just use the DB level error
    >checking, no matter how obtuse the java.sql.Exception messages may be.
    >My next project perhaps?

    This maybe a cool add-on. IIRC we discussed it in September on this list.
    Ironically after that I tried using EOValidation in WebObjects as a
    customizable validation mechanism for the first time in my long WO
    experience. Despite some ugliness catching and rethrowing validation
    exceptions, this works and is an o.k. way to handle validation.

    Andrus



    This archive was generated by hypermail 2.0.0 : Wed Jan 01 2003 - 20:57:12 EST