Cayenne Cache Events

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed Jan 22 2003 - 17:46:58 EST

  • Next message: Andrus Adamchik: "Re: Writing a PostgreSQL plugin"

    Planning to take advantage of our new notification API ;)

    The idea is to implement notification-based object cache management.
    Originally this will be in one instance only, but who knows, maybe we beef
    up our EventHandler to use JavaGroups for cross-VM and cross-machine
    notifications.

    Event Subjects:

    1. "DataObjectsUpdated" - sent by DataContext after commit. Includes a map
    keyed by the ObjectId, with values being snapshot "deltas".

    2. "DataObjectsDeleted" - sent by DataContext after commit. Includes a
    list of ObjectIds.

    3. "DataObjectsShouldBeInvalidated" - sent by whoever wants to clean up
    the cache. Need to think some more about the originating API. Includes the
    list of ObjectIDs, or an entity name (for cleaning up stuff for the
    entity), or no additional info - for invalidating all cache.

    Each ObjectStore will be a subscriber for these events. I need to think
    some more on handling each individual scenario, but it will probably try
    to merge everything it can. A few things to think about:

    - An object is deleted, but is cached in another ObjectStore.
    - An object is updated, but is also updated by the owner of a different
    ObjectStore.
    - An object should be invalidated, but it has changes.

    Andrus



    This archive was generated by hypermail 2.0.0 : Wed Jan 22 2003 - 17:46:59 EST