ITransactionContext interface (comsvcs.h)

Enables you to compose the work of multiple COM+ objects in a single transaction and explicitly commit or abort the transaction.

ITransactionContext and ITransactionContextEx provide the same functionality, but unlike ITransactionContextEx, ITransactionContext is compatible with Automation.

Inheritance

The ITransactionContext interface inherits from the IDispatch interface. ITransactionContext also has these types of members:

Methods

The ITransactionContext interface has these methods.

 
ITransactionContext::Abort

Aborts the work of all COM objects participating in the current transaction. The transaction ends on return from this method. (ITransactionContext.Abort)
ITransactionContext::Commit

Attempts to commit the work of all COM objects participating in the current transaction. The transaction ends on return from this method. (ITransactionContext.Commit)
ITransactionContext::CreateInstance

Creates a COM object that can execute within the scope of the transaction that was initiated by the transaction context object. (ITransactionContext.CreateInstance)

Remarks

Using the transaction context object to control a transaction limits the reuse of the business logic driving the transaction and should be used sparingly.

You obtain a reference to the ITransactionContext interface by creating a transaction context object with the appropriate call, as in the following example.

hr = CoCreateInstance(
       CLSID_TransactionContext, 
       NULL, 
       CLSCTX_INPROC,
       IID_ITransactionContext, 
       (void**)&m_pTransactionContext);

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header comsvcs.h

See also

ITransactionContextEx

TransactionContext