다음을 통해 공유


How to Coordinate Updates to Orders

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

If multiple sites or applications can access the Orders database at the same time, there is a chance that orders could be corrupted. Commerce Server lets you control concurrent access to the orders database by defining which applications can modify an order. Additionally, you can provide a list of statuses, and Commerce Server will only allow an application to modify an order if the order’s status is in the list.

To enable Commerce Server to manage concurrent access to the Orders database, you must perform the following actions:

  1. Specify the valid order status values.

  2. Indicate that Commerce Server should control access to the orders database.

  3. Specify the status for a newly created order.

  4. Update the table that identifies which applications can modify an order, and which statuses indicate that an order can be modified.

To Specify the Valid Order Status Values

Add the valid status values to the AllowedStatus table in the TransactionConfig database.

Commerce Server provides the following status values by default:

  1. NewOrder

  2. Submitted

  3. InProcess

  4. Cancelled

  5. Rejected

  6. Shipped

To Indicate that Commerce Server Should Control Access to the Orders Database

Add the honorStatus attribute to the orders element in the Web.config file. Set honorStatus to true to enable Commerce Server to control when orders can be modified.

<orders honorStatus=”true”>

To Specify the Status for a Newly Created Order

Add the newOrderStatus attribute to the orders element in the Web.config file. Set newOrderStatus to the status that Commerce Server should use when it creates a new order.

Note

The value of newOrderStatus must be one of the valid status values that you defined in the AllowedStatus table.

<orders honorStatus=”true” newOrderStatus=”NewOrder”>

To Create a Table that Identifies Which Applications Can Modify an Order and Which Statuses Indicate that an Order Can Be Modified

Add the allowed combinations of application and status to the StatusManager table in the TransactionConfig database. When an application uses one of the data management APIs to modify an order, Commerce Server checks that the application’s ID and the order’s status are in the StatusManager table before permitting the modification.

The following table lists the default applications and statuses that Commerce Server provides.

ApplicationID

FromStatus

Description

Site

NewOrder

Site can modify new orders

LOB Adapter

NewOrder

Line-of-business (LOB) adapters can modify new orders

LOB Adapter

Submitted

LOB adapters can modify orders that have been submitted

LOB Adapter

InProcess

LOB adapters can modify orders that are being processed

Note

The ApplicationID is a user-defined string that you provide as an argument to the data management APIs.

Note

The FromStatus value must be one of the valid status values that you defined in the AllowedStatus table.

Note

If you enable Commerce Server to control access to the Orders database, you must use the overloaded Save method instead of the Save method.

See Also

Other Resources

orders Element

Developing with the Orders System