Invalidating WebSphere Commerce data cache entries
When data in the database is created, updated, or deleted, using WebSphere Commerce tools, the cache is kept automatically up to date. Data that is updated with methods such as loading of catalog or price data might have to be invalidated with other methods of cache invalidation.
Procedure
WebSphere Commerce provides two extra methods of performing
cache invalidation:
- Use Java programming to call the methods of the com.ibm.commerce.datatype.WCDataCache Java class. These methods accept the database table name, and optionally the column names and values in a row that was created, updated, or deleted, and perform the appropriate cache invalidations. WCDataCache works when running within the WebSphere Commerce environment and does not work when running in a stand-alone Java utility.
- Define and use the database triggers defined in the wcs.cacheivl.trigger.sql script. These database triggers cause specially formulated invalidation IDs to be appended to the CACHEIVL database table, in the DATAID column. The DynaCacheInvalidationCmd scheduler job processes the CACHEIVL rows and issues appropriate cache invalidations. When this technique is used, there is a time between when the database changes are made and when the DynaCacheInvalidation scheduler job performs the invalidations. During that time period, the old stale cached data is used.