[OS-JIRA] Created: (CAY-489) performQuery overwrites local modifications in toMany relationships

From: Robert Wruck (JIRA) ("Robert)
Date: Mon Apr 03 2006 - 09:10:49 EDT

  • Next message: Andrus Adamchik (JIRA): "[OS-JIRA] Created: (CAY-490) On client class generation, cgen should automatically filter out entities that are explicitly not supported on the client"

    performQuery overwrites local modifications in toMany relationships
    -------------------------------------------------------------------

             Key: CAY-489
             URL: http://objectstyle.org/jira/browse/CAY-489
         Project: Cayenne
            Type: Bug
      Components: Cayenne Core Library
        Versions: 1.1
        Reporter: Robert Wruck

    Here's my scenario:

    I have an Object of class A that has a toMany relationship to B.

    myA.getBList() returns a list of, say, 3 objects.

    I locally add an instance of B:

    myA.addToBList(myB);

    Now, myA.getBList() returns a list of 4 objects.

    If after that I perform a SelectQuery returning (among others) myA, myA.getBList() returns only the priginal 3 objects.
    I haven't done a commit yet, so I do now. All 4 (!) objects are written to the DB and after restarting the application, myA.getBList() returns 4 objects again.

    IMHO, performing a SelectQuery should not overwrite relationships of objects with PersistenceState.MODIFIED.

    -- 
    This message is automatically generated by JIRA.
    -
    If you think it was sent incorrectly contact one of the administrators:
       http://objectstyle.org/jira/secure/Administrators.jspa
    -
    For more information on JIRA, see:
       http://www.atlassian.com/software/jira
    



    This archive was generated by hypermail 2.0.0 : Mon Apr 03 2006 - 09:15:06 EDT