Setting MTS Transaction Properties
[This product will work only on Windows NT 4.0 versions and earlier. For Windows 2000 and later, see COM+ (Component Services).]
You should determine if you want your application to support transaction at design time, and then use the Microsoft Transaction Server Explorer during deployment to set the component transaction property. The Transaction tab on the property sheet determines how a component supports transactions. You can select one of the following settings for component transaction properties:
- Requires a transaction This indicates that the component's objects must execute within the scope of a transaction. When a new object is created, its object context inherits the transaction from the context of the client. If the client doesn't have a transaction, MTS automatically creates a new transaction for the object.
- Requires a new transaction This indicates that the component's objects must execute within their own transactions. When a new object is created, Transaction Server automatically creates a new transaction for the object, regardless of whether its client has a transaction.
- Supports transactions This indicates that the component's objects can execute within the scope of their client's transactions. When a new object is created, its object context inherits the transaction from the context of the client. If the client doesn't have a transaction, the new context is also created without one.
- Does not support transactions This indicates that the component's objects shouldn't run within the scope of transactions. When a new object is created, its object context is created without a transaction, regardless of whether the client has a transaction.
Whenever an instance of a component is created, MTS checks the component's transaction attribute to determine whether the instance should run in a transaction.
Not all components are designed to support transaction processing. If your component is not designed to use transaction processing, make sure that the transaction attribute on the component's Transaction tab is set to Does not support transactions.
Note that you cannot modify transaction attributes if components in the package have been locked. For more details, see Locking Your Package.
To set component transaction properties
- Select the component you want to configure.
- On the Action menu, click Properties, and select the Transaction tab. You can also access the property sheets by selecting the item and either right-clicking and choosing Properties, or clicking the Properties button on the MTS toolbar.
- Click the appropriate transaction attribute box.
- Click OK.
For an overview of distributed transactions and instructions on how to monitor and manage transactions, see the Managing MTS Transactions.
See Also
Setting MTS Package Properties, Setting MTS Activation Properties, Setting MTS Authentication Levels, Locking Your MTS Package