Whenever a user that is a member of a segment begins a Self Service session, ATG Service caches a snapshot of all of the segments in which the user is a member. Every time the user logs in, this snap shot is invalidated and then recomputed.

Calculating the user’s membership within a segment requires a great deal of operation time, making it ineffective to compute the set every time a search is performed. As such, a cache is stored with the user’s segment membership. In some cases, a user with the correct access to both segments and solutions may be unable to access a solution. This may occur if the user was added to the segment after a solution was created and the cached snapshot of a segment has not been recomputed.

To invalidate snapshots whenever segment membership changes, and thereby create a new snapshot, modify the profileGroupsSnapshotNeedsInvalidation property in the userProfile. When set to true, it will cause the profileGroupsSnapshot property to be invalidated and recomputed, updating the segment when a search action occurs. For example, creating a scenario that sets profileGroupsNapshotNeedsInvalidation=true when a user makes a purchase will cause the segment to evaluate to true next time a search is performed.

The profileGroupsSnapshotTimestamp property tracks the last time the snapshot was computed. You can configure the cachInvalidationIntervalInSeconds attribute to compute the snapshot the next time it is requested if more than the specified amount of time has elapsed since it was last computed. By default, cachInvalidationIntervalInSeconds is set to -1, indicating that it never times out. In the following example, the cachInvalidationIntervalInSeconds has been set to 60, or 1 minute: intervals:

<item-descriptor name="user" default="false" content="false" folder="false"
                 use-id-for-path="false" hidden="false" expert="false"
                 writable="true" cache-mode="simple" id-separator=":">
<property name="profileGroupsSnapshot"
          property-type="atg.repository.ProfileGroupsSnapshotPropertyDescriptor"
          category-resource="categoryProfileGroups"
          display-name-resource="profileGroupsSnapshot"
          data-type="set" component-data-type="string" writable="false"
          queryable="false" required="false" readable="true" hidden="false"
          expert="true" cache-mode="inherit">
    <attribute name="resourceBundle"
                value="atg.svc.scenario.UserProfileTemplateResources"/>
     <!-- Specifies the interval in seconds between cache invalidations. Value of
         -1 disables interval-based cache invalidation -->
    <attribute name="cacheInvalidationIntervalInSeconds" value="60" />
</property>
<!-- Set this transient flag to true to force the profileGroupsSnapshot values to
be recomputed on the next access. After the snapshot is recomputed the flag is
automatically cleared. -->
<property name="profileGroupsSnapshotNeedsInvalidation" data-type="boolean"
          category-resource="categoryProfileGroups"
          display-name-resource="profileGroupsSnapshotNeedsInvalidation"
          writable="true" queryable="false" required="false" readable="true"
          hidden="false" expert="true">
    <attribute name="resourceBundle"
        value="atg.svc.scenario.UserProfileTemplateResources"/>
</property>

Copyright © 1997, 2012 Oracle and/or its affiliates. All rights reserved. Legal Notices