Creating Cache Groups

Each cache group has a cache group policy that defines the data refresh properties/schedule for the mobile business objects (MBOs) within them. Create as many cache groups as required to meet the varying data refresh needs of the MBOs for a given mobile application project.

  1. To launch the New Cache Group wizard, either:
    • Right-click the Cache Groups folder from the WorkSpace Navigator, and select New > Cache Group, or
    • From SAP Mobile WorkSpace, select File > New > Cache Group.
    Note: If you do not see the Cache Groups folder, switch to the Advanced Developer profile.
  2. Specify general properties and the data refresh schedule for the cache group and click Finish.
    • Mobile application project – the mobile application project to which this cache group belongs. This option does not appear if you launch the wizard from the WorkSpace Navigator.
    • Name – name of the cache group.
    • Description – an optional description.
    • Policy – select the policy to be used by all MBOs within the cache group. The cache group policy determines the method and timing by which the SAP Mobile Server cache is refreshed from the enterprise information system (EIS) for all MBOs within the cache group:
      Policy Description

      On demand

      Application logic combined with the cache interval determines when a cache refresh is triggered. The cache is not updated until a request is made of the cache and the cache has expired. If a request is made of the cache and it has expired, there may be a delay responding to the request while the cache is refreshed.

      You can select Partition by Requester and Device Identity only if using an On demand policy. To enable, select this option from the Cache Group Property Policies tab.

      Scheduled

      The cache is refreshed when a scheduled task executes, and can be defined by the SAP Mobile Server administrator or by setting the cache interval. Note that load parameters filled from transient personalization keys can not be used with a scheduled cache type.

      DCN

      The cache never expires. Data refresh is triggered by an EIS Data Change Notification. The cache interval fields are disabled when DCN is selected.

      Online

      Used strictly with Hybrid App applications where access to real-time EIS data is required, bypassing the SAP Mobile Server cache (CDB). See Online Cache Group Policy

      EIS managed

      The EIS manages data refresh through DCN messages, including managing partitions, user subscriptions to those partitions, and data updates. Selecting this option enables:
      • Notify EIS to fetch operation – (Optional) SAP Mobile Platform invokes a REST operation with a predefined interface when there are operation replay records ready to be processed by the EIS.  Upon receipt of the notification the expectation is that the EIS calls back into SAP Mobile Server to retrieve the operation replay records.

        Select an existing REST connection profile or create a new one. Any associated templates are ignored, and the predefined template is added upon deployment to SAP Mobile Server.

         
      • Disable membership tracking – (Optional) determines whether or not SAP Mobile Server needs to maintain client-side state in order to clean up a client device in the event a client is unsubscribed from an EIS partition. If enabled and a client is unsubscribed from an EIS partition, the MBO instances that belong to that partition are removed from the device during the next synchronization. If disabled (default) the rows remain on the device after the next synchronization even though the user is no longer subscribed to the EIS partition. 

        If membership tracking is not required, SAP recommends disabling it since the server-side overhead is considerable.

    • Cache interval – used by both On demand and Scheduled, the cache interval allows you to associate an interval (hour, minute, seconds, and so on) for the cache group. If an application tries to synchronize:
      • Before the cache interval expires – the client application receives the data currently in the SAP Mobile Server cache database (CDB).
      • After the cache interval expires – the CDB is refreshed from the enterprise information system (EIS), and the client synchronizes with the data in the CDB.

        If the cache interval is set to zero, each device-initiated synchronization refreshes the entire cache prior to synchronization. While this ensures the device receives up-to-date EIS data, it is costly in terms of resources.

        A Scheduled cache policy does not support a zero interval.

        Examples include:
        • An On demand policy with a 0 cache interval – each client request for data results in the data being retrieved from the EIS and delivered to the client through the cache, but the cache is immediately invalidated, ensuring the most current EIS data is available to clients.
        • An On demand setting with a two hour cache interval – after each cache refresh, the cache is valid for two hours. Each client request for data is serviced by the cache. When a client requests data at least two hours after the last data refresh, the cache is refreshed from the EIS and the cache interval resets for two hours.
        • A Scheduled setting with a 24 hour cache interval setting – the data is refreshed every 24 hours.
    • Use as default cache group – identifies this cache group as the project's default. All MBOs automatically belong to the default cache group when created, except for local business objects, which cannot belong to a cache group.