次の方法で共有


Save Method

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

Saves the purchase order to the database.

Namespace:  Microsoft.CommerceServer.Runtime.Orders
Assembly:  Microsoft.CommerceServer.Runtime (in Microsoft.CommerceServer.Runtime.dll)

Syntax

'Declaration
Public Overrides Sub Save
'Usage
Dim instance As PurchaseOrder

instance.Save()
public override void Save()
public:
virtual void Save() override
public override function Save()

Exceptions

Exception Condition
UnexpectedContainedTypeException

A collection in a mapped class contains an instance of an unmapped class.

WeaklyTypedPropertyTypeException

A class having weakly-typed properties mapped to specific table columns contains a property value that is incompatible with the column type to which it is mapped.

OptimisticLockException

The row entry of the purchase order was modified in storage after this instance of PurchaseOrder was loaded. Therefore, the purchase order could not be saved.

InvalidOperationException

When this method is called with HonorStatus flag turned on in the configuration file and current application is not allowed to update this order.

Remarks

Use this method to persist the PurchaseOrder to the underlying stores.

When a PurchaseOrder is serialized and saved to the database, the LastModified field is automatically updated even if no recent changes have been made to the PurchaseOrder. Created and LastModified are system properties that are written by the Commerce Server system. If you want to preserve PurchaseOrder properties that reflect historical Created and LastModified values, you should create a set of custom properties that are not overridden by the system.

Save conducts a two-phase commit using a distributed transaction coordinator.

Permissions

See Also

Reference

PurchaseOrder Class

PurchaseOrder Members

Save Overload

Microsoft.CommerceServer.Runtime.Orders Namespace