Technote

(troubleshooting)
Deleting a Sales Catalog does not delete the underlying categories
Problem(Abstract)
You notice only the Catalog to TopCategory relationship is removed in the CATTOGRP table, after deleting a Sales catalog in WebSphere Commerce Accelerator, The TopCategory and all subcategories of the Sales Catalog still exist in the CATGROUP table.
Symptom The following symptoms may occur:

Cause
Only the Sales Catalog to TopCategory relationship is removed, due to a code defect.

A better explanation of the Catalog framework is below:
The CATGROUP table contains ALL the categories in the catalog, including:

  1. all the top categories (normal and Sales)

  2. all the sub categories (normal and Sales as well).


Look at the following 2 catalog trees:



In the CATGROUP table, you will have:
TopCategory 1
TopCategory 2
TopCategory 3
Category 11
Category 12

In the CATTOGRP (Catalog to TopCategory relationship) will have:
Master Catalog --> TopCategory 1
Master Catalog --> TopCategory 2
Sales Catalog1 --> TopCategory 3

Before applying the APAR, deleting "Sales Catalog 1" would remove the last record of CATTOGRP but leave CATGROUP as is.

With the fix, deleting "Sales Catalog 1" would fail so long as you have TopCategory 3 still existing; it forces you to delete TopCategory3 first. Resolving the problem To resolve the problem, do the following:

  1. Delete all of the obsolete/orphaned categories. To delete these categories, examine the content of your catgroup table and manually look up the categories that you do not need, and then delete them with an SQL statement. For example:

    delete from CATGROUP where CATGROUP_ID in (<list of obsolete categories>)

    Do not take the approach of using a SQL to delete all categories in CATGROUP that are not related to a Catalog. In the CATGROUP table, fetching all categories that are NOT associated to a catalog will also fetch subcategories like Category 11 and Category 12 in the example above and potentially all their subcategories. This could potentially delete categories from your master catalog.

  2. To prevent the problem from happening in the future:

    Contact WebSphere Commerce Support for APAR JR27675 and install the APAR.

    With the APAR installed, you will not be able to delete a Sales Catalog as long as it has a category under it.

 

Document Information

Current web document: http://www.ibm.com/support/docview.wss?uid=swg21287736