Re: Validation problem

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Sun Apr 22 2007 - 09:46:41 EDT

  • Next message: Landry Soules: "Re: Validation problem"

    Hi Landry,

    It could be possible that there is another instance of 'Performer'
    created as a side effect of some other operation. One way to verify
    this is to inspect a list of dirty objects returned from
    'DataContext.newObjects()' method right before commit. Another place
    to check for suspect objects is the list returned by
    'DataContext.modifiedObjects()'.

    Andrus

    On Apr 22, 2007, at 4:32 PM, Landry Soules wrote:

    > Hello,
    >
    > I have a strange problem wit my web app.
    > From time to time, i get a "ValidationException" when i submit a form.
    > Here is the trace :
    >
    > org.apache.cayenne.validation.ValidationException: [v.2.0.2 January
    > 14 2007] Validation has failed.
    > Validation failure for eu.kwark.sql.Performer.toGender: "toGender"
    > is required.
    > Validation failure for eu.kwark.sql.Performer.id: "id" is required.
    > Validation failure for eu.kwark.sql.Performer.firstName:
    > "firstName" is required.
    > Validation failure for eu.kwark.sql.Performer.dob: "dob" is required.
    > Validation failure for eu.kwark.sql.Performer.lastName: "lastName"
    > is required.
    > at
    > org.apache.cayenne.access.ObjectStoreGraphDiff.validateAndCheckNoop
    > (ObjectStoreGraphDiff.java:112)
    > at org.apache.cayenne.access.DataContext.flushToParent
    > (DataContext.java:1209)
    > at org.apache.cayenne.access.DataContext.commitChanges
    > (DataContext.java:1130)
    > at eu.kwark.inscription.InscriptionPerformer$1.onSubmit
    > (InscriptionPerformer.java:88)
    >
    >
    >
    > Here is the code executed in my submit :
    >
    > tmpPerformer = (Performer) context.newObject(Performer.class);
    > ...
    > context.commitChanges();
    >
    >
    >
    > Of course all these fields are filled !
    >
    > Please can someone help me, or at least give me a hint about where
    > i can search to solve my problem ?
    >
    > Thanks
    >
    > Landry
    >



    This archive was generated by hypermail 2.0.0 : Sun Apr 22 2007 - 09:47:12 EDT