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

From: Mike Kienenberger (mkienen..laska.net)
Date: Thu Mar 03 2005 - 11:05:52 EST

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

    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 - 11:05:01 EST