Thursday, December 24, 2009

TrashCan User in WCS

Trash Can Users And the mighty fear of loading a junkcarts in Cart.

If the default trash can user is enabled, it would not remove the row from the database directly, but hold in the database with a state 'J', when ever a merge cart or orderitem/requisition is deleted. This is usually done for performance improvement since in a live site when trying to delete order items would result in database issues.

This is configured in wc-server.xml


When this enabled, these orders are not deleted and are moved to a state 'J' (Junk Cart)

-1002 in commerce is the generic user.

In one of the commerce sites that I worked, there were huge performance concerns due to the fact that a certain scenario could load junk carts for user -1002.
We modified the trashcan to use a custom user.