Setting an Operation Cache Policy

Set an operation's cache policy from the Properties view.

  1. From the Mobile Application Diagram, click an operation to access it from the Properties view.
  2. Select the Cache Policy tab.
  3. Select the cache policy, and option. Cache-affecting operation behavior includes:
    • Immediately update the cache with Apply merge of operation – the attributes passed in from the client are combined with the results from the EIS, and merged into the cache using a graph-based merge algorithm. All MBOs in the composite relationship must be mapped to a result.

      The legacy "Apply results to the cache" mode is used if only one result is mapped; otherwise, all MBOs in the composite relationship must be mapped to a result.

      Operations with this cache policy and option cannot be combined with the "Invalidate the cache" policy if more than one result is mapped.

    • Immediately update the cache with Apply output of Entity Read operation – the results from the EIS operation determine the primary key of the entity to be read from the EIS. You can also use client attributes to specify the primary key when the primary key is not contained in the EIS result. The entity is read in its entirety using the specified Entity Read operation. The result is merged into the cache using a graph-based merge algorithm. All MBOs in the composite relationship must be mapped to an entity read result, otherwise, the MBO model is invalid. You must create an Entity Read operation before you can use this cache policy.

      Operations with this cache policy and option cannot be combined with the "Invalidate the cache" policy.

    • Legacy Immediately update the cache (Apply results to the cache) – if an operation uses the "Immediately update the cache" policy with the "Apply merge of operation input/output" option, and only one result is mapped, the legacy "Apply operations results" behavior is used, including the ability to upsert many MBO instances into the cache if the associated EIS operation returns more than one MBO instance.

      Unwired WorkSpace does not indicate that legacy mode is used, but the API infers this from the fact that only one result is mapped. Legacy "Apply results to the cache" simply upserts rows into the cache. It does not perform a graph-based merge and consequently does not detect deletions.

    • None – if you unselect all check boxes for Create or Update operations, the operation has no explicit effect on the CDB. Data refresh depends on other mechanisms to update the CDB, for example, the cache group to which the MBO belongs or data change notification (DCN). These are the behaviors for operations which do not have an explicitly modeled cache effect:
      • None - Create – an implicit cache effect: a row is created in the cache and marked as Create pending such that it is invisible during client synchronization until the next refresh operation updates the pending row. This behavior ensures that the surrogate key-to-primary key affinity is maintained when the primary key is specified on the client device. If the primary key is not specified on the client device, a logically deleted row with the provided surrogate key is created in the cache.
      • None - Update – have no effect on the cache.
      • None - Delete – You cannot define a Delete operation in Unwired WorkSpace without a cache effect.
    • Delete Operation – apply results to the cache using the "Immediately update the cache" cache policy.
    • Invalidate the cache – restricts invalidation to only those cache partitions affected by the Create or Update operation. Unless otherwise specified, each previously described cache-affecting operation behavior can optionally invalidate the cache. An operation that uses the invalidate cache policy:
      • Performs the Create or Update operation, for example, inserts a new record or updates an existing record in the enterprise information system (EIS).
      • Unless the client is using asynchronous operation replay, the cache invalidates and refreshes during the same synchronization session which executed the invalidation operation for those MBO partitions affected by the operation (not the entire MBO instance). That is, for operations where both "Apply merge of operation input/output" and "Invalidate the cache" are selected, when the device synchronizes (for example, an update operation) which also requests a download/synchronization, the:
        • Cache is updated
        • Affected partition refreshes
        For operations where both "Apply merge of operation input/output" and "Invalidate the cache" are selected, and a download/synchronization is not requested, the:
        • Cache is updated
        • Affected partition refreshes on the next download/synchronization request from the client