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.
Modifier and Type | Method and Description |
---|---|
static void |
clearCache()
Generates and issues invalidations for all cache entries with generated dependencies.
|
static 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)
Returns a query result for the specified query and parameters.
|
static void |
generateAndIssueInvalidationsForTable(java.lang.String astrTableName,
int aOperationFlags)
Generates and issues invalidation ids indicating rows have changed in a database table.
|
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.
|
static int |
getCreateOperationMask() |
static int |
getDeleteOperationMask() |
static int |
getUpdateOperationMask() |
static void |
issueInvalidations(java.util.Collection acollInvalidationIds)
Invalidate cache entries with dependencies that match the specified invalidation ids.
|
static com.ibm.commerce.attachment.objects.AttachmentRelationUsageAccessBean |
newAttachmentRelationUsageAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static com.ibm.commerce.attachment.objects.AttachmentRelationUsageDescriptionAccessBean |
newAttachmentRelationUsageDescriptionAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static BusinessPolicyAccessBean |
newBusinessPolicyAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static CalculationCodeAccessBean |
newCalculationCodeAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static CalculationCodeDescriptionAccessBean |
newCalculationCodeDescriptionAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static com.ibm.commerce.tools.epromotion.objects.CalculationCodePromotionAccessBean |
newCalculationCodePromotionAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static CalculationUsageAccessBean |
newCalculationUsageAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static CatalogAccessBean |
newCatalogAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static CatalogDescriptionAccessBean |
newCatalogDescriptionAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static CatalogEntryAccessBean |
newCatalogEntryAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static CatalogEntryDescriptionAccessBean |
newCatalogEntryDescriptionAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static CatalogEntryShippingAccessBean |
newCatalogEntryShippingAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static CatalogGroupAccessBean |
newCatalogGroupAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static CatalogGroupCatalogEntryRelationAccessBean |
newCatalogGroupCatalogEntryRelationAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static CatalogGroupDescriptionAccessBean |
newCatalogGroupDescriptionAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static CatalogGroupRelationAccessBean |
newCatalogGroupRelationAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static ContractAccessBean |
newContractAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static CountryAccessBean |
newCountryAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static CurrencyAccessBean |
newCurrencyAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static CurrencyDescriptionAccessBean |
newCurrencyDescriptionAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static DemographicsAccessBean |
newDemographicsAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static ExtendedTermConditionAccessBean |
newExtendedTermConditionAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static FulfillmentCenterAccessBean |
newFulfillmentCenterAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static ItemAccessBean |
newItemAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static LanguageAccessBean |
newLanguageAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static LanguageDescriptionAccessBean |
newLanguageDescriptionAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static ListPriceAccessBean |
newListPriceAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static MemberAccessBean |
newMemberAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static MemberGroupAccessBean |
newMemberGroupAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static MemberGroupMemberAccessBean |
newMemberGroupMemberAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static MemberRelationshipsAccessBean |
newMemberRelationshipsAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static MemberRoleAccessBean |
newMemberRoleAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static OfferAccessBean |
newOfferAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static OfferDescriptionAccessBean |
newOfferDescriptionAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static OfferPriceAccessBean |
newOfferPriceAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static OrganizationAccessBean |
newOrganizationAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static PolicyDescriptionAccessBean |
newPolicyDescriptionAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static ProductAccessBean |
newProductAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static RelatedCatalogEntryAccessBean |
newRelatedCatalogEntryAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static RoleAccessBean |
newRoleAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static ShippingArrangementAccessBean |
newShippingArrangementAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static ShippingModeAccessBean |
newShippingModeAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static ShippingModeDescriptionAccessBean |
newShippingModeDescriptionAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static StateProvinceAccessBean |
newStateProvinceAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static StoreEntityDescriptionAccessBean |
newStoreEntityDescriptionAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static com.ibm.commerce.messaging.objects.StoreTransAccessBean |
newStoreTransAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static SupportedLanguageAccessBean |
newSupportedLanguageAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static TaxCategoryAccessBean |
newTaxCategoryAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static TaxCategoryDescriptionAccessBean |
newTaxCategoryDescriptionAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static TermConditionAccessBean |
newTermConditionAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static TicklerAccessBean |
newTicklerAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static TradingDescriptionAccessBean |
newTradingDescriptionAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static UserAccessBean |
newUserAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static UserRegistryAccessBean |
newUserRegistryAccessBean()
Returns a new access bean that can take advantage of the cache.
|
static boolean |
requiresInvalidations(java.lang.String astrTableName)
Returns true if invalidations must be issued for the specified table.
|
public static void clearCache()
public static void issueInvalidations(java.util.Collection acollInvalidationIds)
acollInvalidationIds
- Each element must be a String, representing an invalidation id.public static int getCreateOperationMask()
public static int getUpdateOperationMask()
public static int getDeleteOperationMask()
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.
astrTableName
- the name of the database table.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.
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().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.
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().public static final com.ibm.commerce.attachment.objects.AttachmentRelationUsageAccessBean newAttachmentRelationUsageAccessBean()
public static final com.ibm.commerce.attachment.objects.AttachmentRelationUsageDescriptionAccessBean newAttachmentRelationUsageDescriptionAccessBean()
public static final BusinessPolicyAccessBean newBusinessPolicyAccessBean()
public static final CalculationUsageAccessBean newCalculationUsageAccessBean()
public static final CalculationCodeAccessBean newCalculationCodeAccessBean()
public static final CalculationCodeDescriptionAccessBean newCalculationCodeDescriptionAccessBean()
public static final com.ibm.commerce.tools.epromotion.objects.CalculationCodePromotionAccessBean newCalculationCodePromotionAccessBean()
public static final CatalogAccessBean newCatalogAccessBean()
public static final CatalogDescriptionAccessBean newCatalogDescriptionAccessBean()
public static final CatalogEntryAccessBean newCatalogEntryAccessBean()
public static final CatalogEntryDescriptionAccessBean newCatalogEntryDescriptionAccessBean()
public static final CatalogEntryShippingAccessBean newCatalogEntryShippingAccessBean()
public static final CatalogGroupAccessBean newCatalogGroupAccessBean()
public static final CatalogGroupCatalogEntryRelationAccessBean newCatalogGroupCatalogEntryRelationAccessBean()
public static final CatalogGroupDescriptionAccessBean newCatalogGroupDescriptionAccessBean()
public static final CatalogGroupRelationAccessBean newCatalogGroupRelationAccessBean()
public static final ContractAccessBean newContractAccessBean()
public static final CountryAccessBean newCountryAccessBean()
public static final CurrencyAccessBean newCurrencyAccessBean()
public static final CurrencyDescriptionAccessBean newCurrencyDescriptionAccessBean()
public static final DemographicsAccessBean newDemographicsAccessBean()
public static final ExtendedTermConditionAccessBean newExtendedTermConditionAccessBean()
public static final TermConditionAccessBean newTermConditionAccessBean()
public static final FulfillmentCenterAccessBean newFulfillmentCenterAccessBean()
public static final ItemAccessBean newItemAccessBean()
public static final LanguageAccessBean newLanguageAccessBean()
public static final LanguageDescriptionAccessBean newLanguageDescriptionAccessBean()
public static final ListPriceAccessBean newListPriceAccessBean()
public static final MemberAccessBean newMemberAccessBean()
public static final MemberGroupAccessBean newMemberGroupAccessBean()
public static final MemberGroupMemberAccessBean newMemberGroupMemberAccessBean()
public static final MemberRelationshipsAccessBean newMemberRelationshipsAccessBean()
public static final MemberRoleAccessBean newMemberRoleAccessBean()
public static final OfferAccessBean newOfferAccessBean()
public static final OfferDescriptionAccessBean newOfferDescriptionAccessBean()
public static final OfferPriceAccessBean newOfferPriceAccessBean()
public static final OrganizationAccessBean newOrganizationAccessBean()
public static final PolicyDescriptionAccessBean newPolicyDescriptionAccessBean()
public static final ProductAccessBean newProductAccessBean()
public static final RelatedCatalogEntryAccessBean newRelatedCatalogEntryAccessBean()
public static final RoleAccessBean newRoleAccessBean()
public static final ShippingArrangementAccessBean newShippingArrangementAccessBean()
public static final ShippingModeAccessBean newShippingModeAccessBean()
public static final ShippingModeDescriptionAccessBean newShippingModeDescriptionAccessBean()
public static final StateProvinceAccessBean newStateProvinceAccessBean()
public static final StoreEntityDescriptionAccessBean newStoreEntityDescriptionAccessBean()
public static final com.ibm.commerce.messaging.objects.StoreTransAccessBean newStoreTransAccessBean()
public static final SupportedLanguageAccessBean newSupportedLanguageAccessBean()
public static final TaxCategoryAccessBean newTaxCategoryAccessBean()
public static final TaxCategoryDescriptionAccessBean newTaxCategoryDescriptionAccessBean()
public static final TradingDescriptionAccessBean newTradingDescriptionAccessBean()
public static final TicklerAccessBean newTicklerAccessBean()
public static final UserAccessBean newUserAccessBean()
public static final UserRegistryAccessBean newUserRegistryAccessBean()
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
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.java.sql.SQLException
ECSystemException