Share via


Data Access and Transactions

cc961186(v=technet.10).md

***** *Using Database Access Interfaces with Component Services

Because the ODBC Driver Manager is a Component Services resource dispenser, data accessed via ODBC is automatically protected by your objects transaction. For object transactions, an ODBC-compliant database must support the following features:

  • The databases ODBC driver must be thread-safe. Component Services must be able to connect to the database, utilize the connection, and disconnect by using different threads. (The Access driver cannot participate in Component Services transactions, because it is not completely thread-safe.)

  • If ODBC is used from within a transactional component, the ODBC driver must also support the OdbcSqlAttrEnlistInDtc connection attribute. Its through the use of this attribute that the ODBC Driver Manager can allow the ODBC driver to enlist a connection on a transaction. If you are using a database without a resource dispenser that can recognize Component Services transactions, contact your database vendor to obtain the required support.

Table 7.6 summarizes database requirements for full COM+ application support.

Table 7.6   ODBC Driver Requirements for Component Services Compliance

Requirements

Description

Support for the OLE transactions specification, or support for XA protocol

Enables direct interaction with the Distributed Transaction Coordinator (DTC) by using the XA Mapper.

ODBC driver

Platform requirement for COM+ application server.

Support for ODBC version 3.0s SqlAttrEnlistInDtc attribute

COM+ applications use this call to pass the transaction identifier to the ODBC driver. The ODBC driver then passes the transaction identifier to the database engine.

Fully thread-safe ODBC driver

ODBC driver must be able to handle concurrent calls from any thread at any time.

Because ADO is an indirect consumer of ODBC data sources, it makes a good candidate for data access from COM components. In fact, there is very little semantic difference between using ADO inside a COM component, and using it from a Web page.