com.ibm.commerce.datatype

Class WCDataCache

  • java.lang.Object
    • com.ibm.commerce.datatype.WCDataCache


  • public final class WCDataCache
    extends java.lang.Object

    The WebSphere Commerce Data Cache is used internally by WebSphere Commerce to cache data such as database query or command execution results.

    Normally cache entries do not need to be explicitly invalidated, since WebSphere Commerce data access layers such as EJB beans and the Data Service Layer will issue appropriate cache invalidations when they make changes to the data used to construct the cache entries.

    However, there may be times when other methods are used to change data in the WebSphere Commerce database, and in those cases the methods provided by this class can be used to explicitly cause necessary cache invalidations to take place.

    • Method Detail

      • clearCache

        public static void clearCache()
        Generates and issues invalidations for all cache entries with generated dependencies.
      • issueInvalidations

        public static void issueInvalidations(java.util.Collection acollInvalidationIds)
        Invalidate cache entries with dependencies that match the specified invalidation ids. Use this method to issue invalidations for custom dependency ids.
        Parameters:
        acollInvalidationIds - Each element must be a String, representing an invalidation id.
      • getCreateOperationMask

        public static int getCreateOperationMask()
        Returns:
        A bit mask to indicate a row was created. Bit masks may be combined to indicate that one of the specified operations occurred.
      • getUpdateOperationMask

        public static int getUpdateOperationMask()
        Returns:
        A bit mask to indicate a row was updated. Bit masks may be combined to indicate that one of the specified operations occurred.
      • getDeleteOperationMask

        public static int getDeleteOperationMask()
        Returns:
        A bit mask to indicate a row was deleted. Bit masks may be combined to indicate that one of the specified operations occurred.
      • requiresInvalidations

        public static boolean requiresInvalidations(java.lang.String astrTableName)

        Returns true if invalidations must be issued for the specified table.

        Use this method when inserts, updates, or updates have been applied to the specified table, to find out if invalidations are required for that table. If this method returns true, then use the generateAndIssueInvalidationsForTable method to perform the required invalidations.

        Parameters:
        astrTableName - the name of the database table.
        Returns:
        true if invalidations must be issued for the specified table.
      • generateAndIssueInvalidationsForTable

        public static void generateAndIssueInvalidationsForTable(java.lang.String astrTableName,
                                                                 int aOperationFlags)

        Generates and issues invalidation ids indicating rows have changed in a database table.

        Use this method when you know the name of the table but do not know the old and new values of columns in the row that has changed.

        Parameters:
        astrTableName - the name of the database table.
        aOperationFlags - the operation that caused the invalidation to be required. Specify one or more bit flags matching getCreateOperationMask(), getUpdateOperationMask(), or getDeleteOperationMask().
      • generateAndIssueInvalidationsForTable

        public static void generateAndIssueInvalidationsForTable(java.lang.String astrTableName,
                                                                 java.util.Map amapColumnName2Value,
                                                                 int aOperationFlags)

        Generates and issues invalidation ids indicating a row has been changed in a database table.

        Use this method when you know the name of the table and the old and new values of columns in the row that has changed.

        When performing an update operation, call this method twice, once to specify the old values and once to specify the new values.

        Parameters:
        astrTableName - the name of the database table.
        amapColumnName2Value - contains String column names mapped to column values, whose toString methods will be called to obtain the values to be included in the generated invalidation ids.
        aOperationFlags - the operations that caused the invalidation to be required. Specify one or more bit flags matching getCreateOperationMask(), getUpdateOperationMask(), or getDeleteOperationMask().
      • newAttachmentRelationUsageAccessBean

        public static final com.ibm.commerce.attachment.objects.AttachmentRelationUsageAccessBean newAttachmentRelationUsageAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newAttachmentRelationUsageDescriptionAccessBean

        public static final com.ibm.commerce.attachment.objects.AttachmentRelationUsageDescriptionAccessBean newAttachmentRelationUsageDescriptionAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newBusinessPolicyAccessBean

        public static final BusinessPolicyAccessBean newBusinessPolicyAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newCalculationUsageAccessBean

        public static final CalculationUsageAccessBean newCalculationUsageAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newCalculationCodeAccessBean

        public static final CalculationCodeAccessBean newCalculationCodeAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newCalculationCodeDescriptionAccessBean

        public static final CalculationCodeDescriptionAccessBean newCalculationCodeDescriptionAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newCalculationCodePromotionAccessBean

        public static final com.ibm.commerce.tools.epromotion.objects.CalculationCodePromotionAccessBean newCalculationCodePromotionAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newCatalogAccessBean

        public static final CatalogAccessBean newCatalogAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newCatalogDescriptionAccessBean

        public static final CatalogDescriptionAccessBean newCatalogDescriptionAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newCatalogEntryAccessBean

        public static final CatalogEntryAccessBean newCatalogEntryAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newCatalogEntryDescriptionAccessBean

        public static final CatalogEntryDescriptionAccessBean newCatalogEntryDescriptionAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newCatalogEntryShippingAccessBean

        public static final CatalogEntryShippingAccessBean newCatalogEntryShippingAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newCatalogGroupAccessBean

        public static final CatalogGroupAccessBean newCatalogGroupAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newCatalogGroupCatalogEntryRelationAccessBean

        public static final CatalogGroupCatalogEntryRelationAccessBean newCatalogGroupCatalogEntryRelationAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newCatalogGroupDescriptionAccessBean

        public static final CatalogGroupDescriptionAccessBean newCatalogGroupDescriptionAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newCatalogGroupRelationAccessBean

        public static final CatalogGroupRelationAccessBean newCatalogGroupRelationAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newContractAccessBean

        public static final ContractAccessBean newContractAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newCountryAccessBean

        public static final CountryAccessBean newCountryAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newCurrencyAccessBean

        public static final CurrencyAccessBean newCurrencyAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newCurrencyDescriptionAccessBean

        public static final CurrencyDescriptionAccessBean newCurrencyDescriptionAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newDemographicsAccessBean

        public static final DemographicsAccessBean newDemographicsAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newExtendedTermConditionAccessBean

        public static final ExtendedTermConditionAccessBean newExtendedTermConditionAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newTermConditionAccessBean

        public static final TermConditionAccessBean newTermConditionAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newFulfillmentCenterAccessBean

        public static final FulfillmentCenterAccessBean newFulfillmentCenterAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newItemAccessBean

        public static final ItemAccessBean newItemAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newLanguageAccessBean

        public static final LanguageAccessBean newLanguageAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newLanguageDescriptionAccessBean

        public static final LanguageDescriptionAccessBean newLanguageDescriptionAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newListPriceAccessBean

        public static final ListPriceAccessBean newListPriceAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newMemberAccessBean

        public static final MemberAccessBean newMemberAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newMemberGroupAccessBean

        public static final MemberGroupAccessBean newMemberGroupAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newMemberGroupMemberAccessBean

        public static final MemberGroupMemberAccessBean newMemberGroupMemberAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newMemberRelationshipsAccessBean

        public static final MemberRelationshipsAccessBean newMemberRelationshipsAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newMemberRoleAccessBean

        public static final MemberRoleAccessBean newMemberRoleAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newOfferAccessBean

        public static final OfferAccessBean newOfferAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newOfferDescriptionAccessBean

        public static final OfferDescriptionAccessBean newOfferDescriptionAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newOfferPriceAccessBean

        public static final OfferPriceAccessBean newOfferPriceAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newOrganizationAccessBean

        public static final OrganizationAccessBean newOrganizationAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newPolicyDescriptionAccessBean

        public static final PolicyDescriptionAccessBean newPolicyDescriptionAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newProductAccessBean

        public static final ProductAccessBean newProductAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newRelatedCatalogEntryAccessBean

        public static final RelatedCatalogEntryAccessBean newRelatedCatalogEntryAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newRoleAccessBean

        public static final RoleAccessBean newRoleAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newShippingArrangementAccessBean

        public static final ShippingArrangementAccessBean newShippingArrangementAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newShippingModeAccessBean

        public static final ShippingModeAccessBean newShippingModeAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newShippingModeDescriptionAccessBean

        public static final ShippingModeDescriptionAccessBean newShippingModeDescriptionAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newStateProvinceAccessBean

        public static final StateProvinceAccessBean newStateProvinceAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newStoreEntityDescriptionAccessBean

        public static final StoreEntityDescriptionAccessBean newStoreEntityDescriptionAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newStoreTransAccessBean

        public static final com.ibm.commerce.messaging.objects.StoreTransAccessBean newStoreTransAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newSupportedLanguageAccessBean

        public static final SupportedLanguageAccessBean newSupportedLanguageAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newTaxCategoryAccessBean

        public static final TaxCategoryAccessBean newTaxCategoryAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newTaxCategoryDescriptionAccessBean

        public static final TaxCategoryDescriptionAccessBean newTaxCategoryDescriptionAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newTradingDescriptionAccessBean

        public static final TradingDescriptionAccessBean newTradingDescriptionAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newTicklerAccessBean

        public static final TicklerAccessBean newTicklerAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newUserAccessBean

        public static final UserAccessBean newUserAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • newUserRegistryAccessBean

        public static final UserRegistryAccessBean newUserRegistryAccessBean()
        Returns a new access bean that can take advantage of the cache.
        Returns:
        a new access bean.
      • executeParameterizedQuery

        public static final java.util.Enumeration executeParameterizedQuery(java.lang.String astrQuery,
                                                                            java.io.Serializable[] aarserParameters,
                                                                            int aInitialIndex,
                                                                            java.util.TreeMap<java.lang.String,java.util.ArrayList<java.util.TreeMap<java.lang.String,java.lang.Object>>> amapTableName2ArrayListOfMapColumnName2Value,
                                                                            java.lang.String astrLogicalCacheName,
                                                                            java.util.Date aExpiryTime)
                                                                     throws java.sql.SQLException,
                                                                            ECSystemException
        Returns a query result for the specified query and parameters. If a result has previously been cached, the cached result is returned. Otherwise, the query is executed, and the result is cached and returned.
        Parameters:
        astrQuery - the SQL query.
        aarserParameters - if this is not null, it provides the parameters for the parameter markers in the query.
        aInitialIndex - the initial zero based index for the returned enumeration.
        amapTableName2ArrayListOfMapColumnName2Value - used to create dependency ids. Each key is a database table name, and each value is either null or is an ArrayList of TreeMap from column name to column value, which may be null. When present, the column names and values indicate particular rows of a table upon which the results of the query depend. When the ArrayList or a TreeMap from column names to column values is null, then the cached query result should be invalidated when any change to the table is made.
        astrLogicalCacheName - the logical name of the data cache to be used. If this is null, then the default logical cache name is com.ibm.commerce.datatype.GenericJDBCQueryCache.
        aExpiryTime - the time when this cache entry should expire, or null for no expiry.
        Returns:
        the query results. Each element is a List of values representing a row in the query result set. The caller should cast each text value as a String, and each numeric value as a Number, as different database types return different kinds of numeric data types. The returned query results must not be modified by the caller, as they may be cached. In order to handle large result sets without holding the whole result set in memory at the same time, the returned Enumeration holds onto an open ResultSet object. To close the ResultSet object, the caller should iterate over the entire Enumeration until hasMoreElements returns false.
        Throws:
        java.sql.SQLException
        ECSystemException