Validation error that shouldn't be (I don't think)

From: Todd O'Bryan (toddobrya..ac.com)
Date: Sun Feb 19 2006 - 09:48:18 EST

  • Next message: Tomi NA: "Re: username/password in node xml definition"

    Cayenne 1.2M10 used in a Tapestry project.

    When the user logs in, the User object is saved.

    I have another object which has a User as its author. I set this by
    doing

    object.setAuthor(getUser());

    When I try to commit, I get lots of errors about the user saying that
    mandatory fields haven't been set. So I printed the User I was trying
    to set as the author, and it turns out that it's

    {[]<oid: <ObjectId:User, id=221>; state: hollow>}

    So, it's in the database, but when I try to commitChanges(), somehow
    Cayenne doesn't realize that all the stuff was set previously.

    Any ideas what I'm doing wrong?

    Todd

    P.S. Even though I save the user's DataContext in the Visit object
    (and thus in the HttpSession), I still get problems where the
    DataContexts of things don't match and balk when I try to set one
    object in a relationship to another object. I still don't know why
    that happens, but localObjects() seems to fix it. I suppose these two
    problems could be related.



    This archive was generated by hypermail 2.0.0 : Sun Feb 19 2006 - 09:48:28 EST