Programming components deployed in MTS or COM+

The following procedure describes how to create components that participate in Distributed Transactions in MTS or COM+.

StepsTo program components deployed in MTS or COM+

  1. Create an IDBSession for each ASE connection.

  2. Create and execute IDBCommand for each update you would like to perform.

  3. Deploy your component to MTS or COM, and configure the transaction attributes as needed.

The COM+, OLE DB Services, and OLE DB provider will take care of creating the transaction, participating in the transaction, and committing or rolling back the transaction.

OLE DB Services is needed for the Automatic Transaction Enlistment. To enable the OLE DB Services, you must follow some rules to initialize the Data Source (see the MS OLE DB documents). To enable the automatic transaction enlistment, you can set the bit DBPROPVAL_OS_TXNENLISTMENT in the OLE_DB_SERVICES registry and in the DBPROP_INIT_OLEDBSERVICES property value, or pass OLE DB Services = 2 in the connection string.