Re: Optimistic locking on delete: appendOptimisticLockingAttributes calls getRetainedSnapshot() but may be null for simple deleteObject()

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Mar 03 2005 - 21:44:49 EST

  • Next message: Mike Kienenberger: "Re: Optimistic locking on delete: appendOptimisticLockingAttributes calls getRetainedSnapshot() but may be null for simple deleteObject()"

    A better test would be to do DataRowStore.forgetSnapshot(...) directly,
    as it will emulate what happens on overflow, and won't have side
    effects on the tested ObjectStore and DataContext.

    Andrus

    On Mar 3, 2005, at 11:05 AM, Mike Kienenberger wrote:

    > Andrus Adamchik <andru..bjectstyle.org> wrote:
    >> what if there is no cached snapshot either (e.g. some snapshots are
    > invalidated manually or removed when a shared cache reaches its size
    > limit)?
    > One solution I see is to retain snapshots of deleted objects (just
    > like we
    > do for the modified ones) if optimistic locking is involved.
    >
    >
    > Andrus, I tried creating failing unit tests by invalidating manually
    > the
    > object to be deleted, but both of these situations work.
    >
    > context.invalidateObjects(Collections.singletonList(object));
    > context.deleteObject(object);
    > context.commitChanges();
    >
    > context.deleteObject(object);
    > context.invalidateObjects(Collections.singletonList(object));
    > context.commitChanges();
    >
    > Is there any point in committing these tests?
    >
    > -Mike
    >



    This archive was generated by hypermail 2.0.0 : Thu Mar 03 2005 - 21:45:33 EST