MTSTransactionMode Property (VB6 only)

Description

Only available when a class is part of an ActiveX DLL project, you should set this property whenever the class is to be registered as a Microsoft Transaction Server (MTS) component. MTS uses this property to determine the level of support a particular component has for transactions. This property is available only at design time.

When MTS components created using VB5 are added to an MTS package, the administrator of the MTS package must manually set the Transaction Support property for the component to operate correctly. VB6 has included the MTSTransactionMode property to ease the burden on MTS administrators either forgetting to set the property or setting the incorrect value. Therefore, developers of MTS components now have more direct control over the way in which their components are registered within MTS.

Values


NotAnMTSObject (Default)

Use this value if the component isn't to be used in Microsoft Transaction Server.


NoTransactions

Use this value if the component is to be a nontransactional part of an MTS package. When the component is installed in MTS, the Transaction property is set to "Does not support Transactions." This value tells MTS that the component shouldn't execute within the context of a transaction regardless of the transactional state of the client.


RequiresTransactions

When the component is installed in MTS, the Transaction property is set to "Requires a Transaction." This means that if the client isn't executing in the context of a transaction, a new transaction is created for this component. However, if the client is executing in the context of a transaction, this component joins in that same transaction.


UsesTransactions

When the component is installed in MTS, the Transaction property is set to "Supports Transactions." There is a subtle yet important difference between a component that supports transactions and one that requires a transaction. A component that supports transactions executes only in the context of a transaction if the client is executing in the context of a transaction, in which case this component will join in that same transaction. If however, the client isn't executing in the context of a transaction, this component won't have a new transaction created for it and won't execute in the context of a transaction.


RequiresNewTransaction

Use this value if the component is to execute in its own transaction. When the component is installed in MTS, the transaction property is set to "Requires a new transaction." This means that regardless of the transactional state of the client, this object is always created in the context of a new transaction.

Programming Tips and Gotchas

For further details about creating Microsoft Transaction Server components using Visual Basic, see my book Creating MTS Components with VB6, soon to be published by O'Reilly & Associates.

See Also

Chapter 4
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.248.90