Re: Weird Behaviour with Nullify rule

From: Jorge Sopena (jsopen..idsa.es)
Date: Wed Oct 20 2004 - 11:09:11 EDT

  • Next message: Mike Kienenberger: ""Browse Data" tool for Cayenne Modeler"

    Mike Kienenberger wrote:

    >Jorge Sopena <jsopen..idsa.es> wrote:
    >
    >
    >>Looking the log, I've realised that in the first case there isn't any
    >>query to DB, is to say, the object is found in DataConext.
    >>Meanwhile in the second case there is a query to DB. why?
    >>
    >>
    >
    >I don't know.
    >
    >
    >Jorge Sopena <jsopen..idsa.es> wrote:
    >
    >
    >>No exactly, in the list is still the object path3 but with
    >>PersistentState.COMITTED.
    >>When I do the delete, Cayenne tries to remove this object from the List
    >>but the method List.contains() yields false.
    >>So Cayenne doesn't remove this object.
    >>The main problem is when I do the selectQuery to get the object path3, a
    >>new object is recover from the DB instead of DataContext.
    >>So, I've got two diferent objects for path3, and the method equals()
    >>return false.
    >>
    >>Why is "path3" recover from DB if it's in the DataContext?
    >>
    >>
    >
    >That's a good question.
    >
    >Can you output the value of the two different path3 objects and compare why
    >they are different? The default .toString() method should be sufficient.
    >
    >Cayenne should not allow two copies of the same object to be in the
    >objectStore.
    >
    >-Mike
    >
    >
    >
    >
    Mike,

    Both objects have the same database information. But the method
    hashCode() returns different result, so they are !equals() objects.
    How can Cayenne know where two objects are the same?

    Jorge



    This archive was generated by hypermail 2.0.0 : Wed Oct 20 2004 - 11:01:14 EDT