Re: R: event handling

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu May 13 2004 - 16:17:09 EDT

  • Next message: Andrus Adamchik: "Re: EOKeyComparisonQualifier"

    On May 13, 2004, at 10:53 AM, Claudio Rosati wrote:

    > Hello Andrus,
    >  
    > a question:
    >  
    > if an object is modified in a PC1 and I receive the notification in
    > PC2, I need to reload the object (of which I already have a reference)
    > to obtain the updated values or not? If yes (and I hope the answer is
    > NO, otherwise I've not well understood cache synchronization ;-), how?
    >  
    > Thanks.
    >  
    > Claudio

    Hi Claudio,

    As you've noticed object refreshing is implemented in
    ObjectStore.snapshotsChanged(..) method. Merging the changes is done
    lazily, so that committed objects are turned into "HOLLOW" instead of
    merging the properties, and thus will be refetched on the next call of
    any "get*" method. I am still undecided if this is the best strategy
    and we may change that. Still this is transparent and you don't need to
    do anything about refreshing your objects.

    Still your view may not know about this change and will not update
    automatically. You may have already figured this out, but the simplest
    strategy to update the view is to implement a DataContextDelegate
    interface and use it for each DataContext
    (http://objectstyle.org/cayenne/api/cayenne/org/objectstyle/cayenne/
    access/DataContextDelegate.html). View update code can be added to
    "finishedMergeChanges" method.

    Andrus



    This archive was generated by hypermail 2.0.0 : Thu May 13 2004 - 16:17:15 EDT