Re: Cayenne CRUD tester and found bugs (1.2M4)

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Sat Jun 11 2005 - 13:24:19 EDT

  • Next message: Mikaël Cluseau: "Re: Cayenne CRUD tester and found bugs (1.2M4)"

    > I'm writing an automated CRUD tester for Cayenne (I will contribute
    > it ;-)).

    This would definitely be extremely handy.

    > 1. I create a DataObject (mandatory attributes and relationships
    > are filled with random values).

    I assume there is a "1.5. commit"?

    > 2. I retreive it (by a refetch() followed by a resolveHollow()).

    "refetchObject" prior to 1.2M4 had a bug - it quietly (and
    incorrectly) allowed refetching of uncommitted new objects. Try it
    with M4,

    > 3. I update it (reput random values in attributes).
    > 4. I delete it.

    > My analyse concludes that the problem doesn't come from deleteObject,
    > too : deleteObject() successfully sets the state to DELETED, and
    > setting
    > the object's persistence state to DELETED eventually implies
    > context.deletedObjects().isEmpty() *if* the objet is correctly
    > registered in context's ObjectStore.
    >
    > And, in fact (this will the the conclusion, it's 2:42 here and I
    > need a
    > sleep now :-)), adding «context.getObjectStore().addObject(obj);» made
    > the deletion work as expected. So, clearly, there is a place where the
    > object is removed from the ObjectStore

    That's very strange ... Cayenne itself wouldn't remove a deleted
    object from the ObjectStore until commit (if this was a bug indeed,
    deletion would stop working for everybody). So you may need to looks
    elsewhere. As I mentioned above I suspect there is no "commit" step
    between 1 and 2.

    Andrus



    This archive was generated by hypermail 2.0.0 : Sat Jun 11 2005 - 13:24:21 EDT