Re: invalidation -> transient patch comments?

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Sat Jan 08 2005 - 21:04:57 EST

  • Next message: Mike Kienenberger: "Re: invalidation -> transient patch comments?"

    On Jan 8, 2005, at 6:29 PM, Mike Kienenberger wrote:

    > I think leaving the deleted objects unchanged makes sense.
    > However, I think that a modified object has to have its backing store
    > updated.
    > Otherwise, optimistic locking will fail.
    > Also if the modification is rolled back, the object will be out of
    > sync,
    > won't it?

    Agreed, good point.

    > I mostly copied the merge code from the processUpdatedSnapshots method.
    > My understanding was that
    >
    >> DataRow diff = getSnapshot(oid, context);
    >
    > would refetch the data from the database since the snapshot has no
    > cache at
    > this point.

    Here is the method in question:

         public synchronized DataRow getSnapshot(ObjectId oid, QueryEngine
    engine) {
             DataRow retained = getRetainedSnapshot(oid);
             return (retained != null) ? retained :
    getDataRowCache().getSnapshot(oid, engine);
         }

    The first line ("getRetainedSnapshot") will cause problems - it
    accesses a special local cache for modified objects. "Retained"
    snapshot is taken when an object is first modified and is stored
    locally in the ObjectStore... So this is not the fresh "diff" but
    rather a potentially stale old snapshot.

    So looks like a manual snapshot DataRow fetch is needed to obtain a
    valid "diff".

    Andrus



    This archive was generated by hypermail 2.0.0 : Sat Jan 08 2005 - 21:05:02 EST