Friday, October 14, 2011

Inventory issues

A. Enable the following trace components on your WebSphere Commerce instance server:

com.ibm.websphere.commerce.WC_ORDER=all:com.ibm.websphere.
commerce.WC_INVENTORY=al
l

B. The environment is now configured to capture the necessary data when the problem occurs. Reproduce the problem on your environment and proceed to the next step.

3. Collect all necessary data

1. Trace from the WebSphere Commerce Server:
\logs\server1\*
2. What type of inventory system are you using for your store? For example: Are you using WebSphere Commerce to manage your inventory, are you integrating with a backend system, or are you not tracking inventory at all?
To determine the type of inventory, run the following query:

SELECT INVENTORYSYSTEM FROM STORE WHERE STORE_ID=

The possible values are:

-1=ATP
-2=Non-ATP
-3=No inventory
-4=External inventory management system (introduced in WC 6.0.0.1)

3. Configuration Data from the Database

a) SELECT * FROM STORE
b) SELECT * FROM FFMCENTER
c) SELECT * FROM SHPARRANGE
d) If you are using the ATP inventory, collect the following data:

SELECT * FROM BASEITEM WHERE BASEITEM_ID=(SELECT BASEITEM_ID FROM CATENTRY WHERE CATENTRY_ID=)
SELECT * FROM STOREITEM WHERE BASEITEM_ID=
SELECT * FROM ITEMSPC WHERE BASEITEM_ID=
SELECT * FROM INVSTVW WHERE STORE_ID= AND
ITEMSPC_ID=(SELECT ITEMSPC_ID FROM CATENTRY WHERE CATENTRY_ID=)

Otherwise, if you are using non-ATP inventory, collect the following data:
SELECT * FROM INVENTORY WHERE STORE_ID= AND CATENTRY_ID=

Scenario
Describe the failing scenario in detail.


Monday, October 3, 2011

No Products Can Be Added To Shopping Cart

All WebSphere Commerce sites running version 5.6.x, 6.0 and 7.0 might experience this problem.

Shoppers cannot add items to the shopping cart. A message similar to the following is displayed when the shopper adds an item:

CMN2022E: The command is unable to determine an appropriate fulfillment center for an OrderItem.

Content

PROBLEM:

When shoppers try to add items to cart, the following exception is displayed in the trace log with WC_ORDERS:

[6/23/08 4:40:18:116 CDT] 7bd409f2 WC_ORDER d mrCJugify4dA55bTXDzHHQEg6SE%3d%0a com.ibm.commerce.fulfillment.commands.ShippingArrangementWrapper.isValid Shipping arrangement 10001 is not effective for the specified time.
com.ibm.commerce.fulfillment.commands.ResolveFulfillmentCenterCmdImpl.performExecute No fulfillment center has enough inventory: catalogEntryId=333109, quantity=1.0, shipModeId=10001
[6/23/08 4:40:18:117 CDT] 7bd409f2 CommerceSrvr E com.ibm.commerce.fulfillment.commands.ResolveFulfillmentCenterCmdImpl performExecute CMN2022E: The command is unable to determine an appropriate fufillment center for an OrderItem.


NOTE: If you are not experiencing this problem on your site then your store was not published with this condition and no immediate actions are required.



SOLUTION:
Check the SHPARRANGE table and verify that the ENDDATE field has not expired. If it has expired or is set to expire on a date earlier than desired for your site, update this field as per the examples below.

Below are some examples of how to change the ENDDATE.


To change the shipping ENDDATE from '2008-06-22-23.00.00.000000' to a setting which will never expire, update the database with one of the following statements:

For DB2:
"update shparrange set enddate = null where enddate = '2008-06-22-23.00.00.000000'"

For Oracle:
"update shparrange set enddate = null where enddate = timestamp'2008-06-22 23:00:00'"



To change the shipping arrangment ENDDATE from '2008-06-22-23.00.00.000000' to expire in 2018, update the database with one of the following statements:

For DB2:
"update shparrange set enddate = '2018-06-22-23.00.00.000000' where enddate = '2008-06-22-23.00.00.000000'"

For Oracle:
"update shparrange set enddate = timestamp'2018-06-22 23:00:00' where enddate = timestamp'2008-06-22 23:00:00'"

Tunning WCS Developer toolkit

In addition to increasing the JVM heap size, you can perform few more tuning to developer toolkit to improve the performance of development toolkit.

Tuning Apache Derby Database

Derby is a filesystem based database, there are few minor configuration changes that can be
performed on the toolkit Derby properties to improve overall performance of the WCS Developer Toolkit.

The file is located in following location for WCS V7:
IBM\SDP\runtimes\base_v7\derby\derby.properties


With this Derby will be able to access data from cache instead of filesystem, this will reduce overall I/O as data will be read from the cache.

derby.storage.pageCacheSize = 10000
derby.storage.pageSize = 8192