Configuring PromotionArgument database records to reduce locking conflicts
You can configure your site to use PromotionArgument records from multiple database tables to reduce database table locking issues, and improve overall storefront performance.
Before you begin
- No custom code exists that relies on records in the PX_PROMOARG database table.
- The
VoucherAdjustment
promotion adjustment is not being used. This adjustment offers a coupon to a customer when a promotion is applied and an order submitted. By default, this adjustment is not used. For your site to use this adjustment, customization is required.
About this task
When a promotion is evaluated, the results of the evaluation, called
PromotionArguments
, are persisted in the PX_PROMOARG database
table. These records are used whenever an order is placed to perform the following actions: - Update promotion usage statistics in the PX_USAGE database table.
- Mark redeemed promotion codes and coupons.
- Release unused promotion codes and coupons.
- Remove obsolete promotion reward choice records.
PromotionArgument
actions are performed by looking at
records in the ORDADJUST, CLCDPROMO, PX_CDUSAGE,
PX_CDPROMO, PX_COUPON, PX_PROMOTION tables
instead of the PX_PROMOARG table. This configuration can result in an overall
storefront performance improvement.Procedure
-
Open a connection to your database, and run the following SQL insert statement:
INSERT INTO CMDREG (STOREENT_ID, INTERFACENAME, CLASSNAME) VALUES (0,'com.ibm.commerce.order.calculation.FinalizeDiscountCalculationUsageCmd', 'com.ibm.commerce.order.calculation.FinalizeDiscountCalculationUsageNoPromoargCmdImpl');
Note: The SQL statement is separated into different lines for display purposes. You might need to format the SQL statement into a single line to run successfully. -
Change the implementation class for
PromotionArgumentPersistenceManager
: Modify the file - Restart the server.