Duplicate instances of same object in single dataContext ?

From: Damir Bijuklic (damirbijukli..ahoo.com)
Date: Mon Sep 12 2005 - 10:11:24 EDT

  • Next message: Mike Kienenberger: "Re: JForum for Cayenne now up"

    Hi.

    I have a wierd problem, so i would like to discuss it
    with the memebers.

    Is it possible to have two different object instances
    in the same DataContext representing same row from the
    database (same PK) ?
    I thought not but i seem to have them.
    One instance is fetched via to-one relationship of
    parent object, while other is fetched via SelectQuery.

    I have verified with the debugger that both instances
    point to the same DataContext.

    I have tried recreating db and object relationship,
    and generated objects but the problem persists.

    When i try to commit changes to the database cayenne
    saves the change to the master table and makes dummy
    updates to the lookup table looking like this:

    UPDATE Lookup SET ID = 1 WHERE ID = 1;

    I have another almost identical relationship with the
    same creation and access patterns which is behaving
    properly? And dozens more of simmilar situations all
    working as expected.

    I'm using tapestry with cayenne, with DataContext
    inside visit.
    I use both relationships inside PropertySelection
    which i have fixed for now by implementing equals on
    base object.

    ...

    Bah, quite a mail just to confirm i'm not
    misunderstanding something. I'm using 1.2b4 version,
    i'm going to try to use latest version or CVS snapshot
    and see...

    Damir

                    
    __________________________________
    Yahoo! Mail - PC Magazine Editors' Choice 2005
    http://mail.yahoo.com



    This archive was generated by hypermail 2.0.0 : Mon Sep 12 2005 - 10:11:25 EDT