Oracle8i: Integration with Microsoft Transaction Server

Technical White Paper

May 1999

 

 

OVERVIEW

Oracle8i for Windows NT provides Oracle Services for Microsoft Transaction Server (MTS). The Oracle Services for MTS permit enhanced deployment of COM components in MTS, using an Oracle database as the resource manager. Specifically, these services offer client-side connection pooling to MTS, and allow COM components to be identified as transactional for MTS to control.

Once the Oracle Services for MTS product is installed, the system administrator creates NT services for each Oracle database accessed by MTS COM components. These services map all OLE transactions to Oracle transactions, and handle any recovery scenarios.

The following diagram illustrates the overall, three-tier model including Oracle Services for MTS.

 

ARCHITECTURAL MODEL

When a client computer initiates a transaction request, MTS enlists the Oracle database to act as a resource manager (RM) in the transaction process. The focal point of the transaction process is a component of MTS called Microsoft Distributed Transaction Coordinator (MS DTC). The diagram below illustrates how the various components perform a transaction.

This model includes several important components:

Client computer connection - Activates the application components using a Web browser or other remote connection.

Application logic components - Embed the business logic. If the component is transactional, MTS initiates a transaction. These components also acquire pooled connections to an Oracle database through the Oracle resource dispenser and a supported API for the Oracle Services for MTS. Application logic components decide the outcome of the operation by notifying MTS of its decision to commit or abort the changes to all RMs.

OCI, OO4O, ODBC, OLEDB - Obtain a service context to the Oracle8i database through the connection pooling component. ODBC also provides connection pooling resources, if necessary.

Connection pooling - Contacts the Oracle database for the location of its Oracle Service for MTS, connects and sends a message to the Oracle Service for MTS requesting to enlist the RM (Oracle database) in the transaction, and starts an Oracle global transaction corresponding to the MTS transaction of which the component is a part. Connection pooling also acts as a resource dispenser to perform client-side connection pooling.

Oracle Service for MTS - Enlists the Oracle database in the transaction and provides the COM communication interface between MTS (and its MS DTC component) and the Oracle database. MS DTC commits and aborts transactions through the Oracle Service for MTS. The Oracle Service for MTS also provides transaction support in the MS DTC and performs recovery of transactions in case of failure. The service runs on a Windows NT computer, but can communicate through a Net8 network connection with Oracle databases running on multiple operating systems.

MS DTC (part of MTS) - Commits and aborts transactions using the two-phase commit protocol. MS DTC also keeps track of transactions that require recovery. Multiple MS DTCs can be involved in a single transaction. When the RM (Oracle database) is enlisted in a transaction, a connection is opened between the client MS DTC and the RM MS DTC. When the client MS DTC commits or aborts a transaction, it sends the request through all involved RM MS DTCs. The transaction request is then passed to the Oracle Service for MTS, which sends it to the Oracle database.

Oracle8i database - Acts as an RM for MTS. The client transaction request is performed on this database.

The following diagram elaborates the internal workings of a transaction processed through the Oracle Services for MTS.

There are four major steps in such a transaction. First, MTS starts a transaction with the DTC, indicating that the COM component will run in a transaction environment. Second, MTS enlists Oracle in the MTS transaction. Third, the COM component performs the application logic. Fourth, the DTC commits or aborts the transaction via the Oracle Services for MTS.

Note that the Oracle Services for MTS refers to the proxy that represents the Oracle database to the DTC. Also, COM components that use the Oracle Services for MTS must use the client library for the Oracle Services for MTS; typically, use of this library will be automatically handled by the programming interface.

 

PROGRAMMING INTERFACES

The Oracle Services for MTS support COM components developed using the Oracle Call Interface (OCI), Oracle Objects for OLE (OO4O), and Open Database Connectivity (ODBC). Any additional APIs based on these technologies, such as ADO and Oracle's OLE DB driver, will also function.

If an application component runs in an MTS-coordinated transaction, then connection pooling is always used, and MTS (and its MS DTC component) coordinate the creation, startup, management, and commitment phases of the transaction. MTS ensures that all changes made by the component are committed if the transaction succeeds, or are aborted if the transaction fails. In the cases of OO4O and OCI, connection pooling is handled by the Oracle Services for MTS client library; OLE DB and ODBC, however, use the OLE DB services and the ODBC driver manager, respectively.

If an application component does not run in an MTS-coordinated transaction, then the component runs in an MTS environment, but its MS DTC component may or may not coordinate communication between the Oracle Service for MTS and the Oracle database. If the transaction is not MS DTC-coordinated, then the client application must create, start, manage, and commit the transaction. Connection pooling may still be used, depending upon how the client application is programmed.

ADO and OO4O are the preferred top-level APIs for the development of applications using the Oracle Services for MTS. If coding with ADO, the provider connect string must be customized to employ the correct OLE DB driver.

OLE DB driver

Provider connect string

Oracle OLE DB

Provider=oraOLEDB.Oracle;Data Source=< net8 alias>;User ID=< userid>;Password=< password>

Microsoft OLE DB for ODBC

Provider=MSDASQL;DSN=< system dsn>; UID=< user id>;PWD=< password>

If coding with OO4O, there are no special requirements.

 

VERSION SUPPORT

The Oracle database supports MTS through two solution paths. This paper is primarily concerned with the Oracle solutions, which leverage the Oracle Services for MTS. The Microsoft paths rely on Oracle's XA functionality, and cannot use the Oracle Services for MTS.

Specifically, the Oracle database interfaces with MTS through several API stacks. In general, the Oracle API stacks (i.e., the Oracle solutions) must be used in conjunction with Oracle8i. The Microsoft API stacks (i.e., the Microsoft solutions) must be used with Oracle 7.3.4 and 8.0.5. Following is a diagram demonstrating the basic stacks.

Here, the first, third, and fourth stacks (using OO4O, Oracle OLE DB, and Oracle ODBC) are primarily Oracle API stacks, and thus must use the Oracle Services for MTS. The second and fifth stacks (using Microsoft OLE DB for Oracle and Microsoft ODBC) are primarily Microsoft stacks.

The following matrix illustrates version compatibility in more detail.

API stack

Oracle clients supported

Oracle servers supported

Oracle

8i

8.0.6 (planned), 8i

Microsoft

7.3.4, 8.0.5

7.3.4, 8.0.x, 8i

 

ADVANTAGES

There are several important differences between the Oracle and Microsoft MTS solutions. As mentioned above, the Oracle solutions rely on the Oracle Services for MTS. These services provide superior performance and reliability. An Oracle Service for MTS must exist for each database that will be used with MTS. Also, the Oracle solutions permit development in all APIs, including OO4O and OCI.

The Microsoft solutions do not employ the Oracle Services for MTS. Instead, they rely on Oracle's XA functionality, which allows distributed transaction operations. In addition, the Microsoft solutions store recovery information in the DTC, whereas the Oracle solutions store such information in the database. Consequently, the Oracle solutions are safer and faster.

 

MORE INFORMATION

Visit the Oracle Technology Network (http://technet.oracle.com) for additional information.

 

 

Oracle Corporation
World Headquarters
500 Oracle Parkway
Redwood Shores, CA 94065
U.S.A.

Worldwide Inquiries:
+1.650.506.7000
Fax +1.650.506.7200
http://www.oracle.com/

Copyright © Oracle Corporation 1999
All Rights Reserved

This document is provided for informational purposes only, and the information herein is subject to change without notice. Please report any errors herein to Oracle Corporation. Oracle Corporation does not provide any warranties covering and specifically disclaims any liability in connection with this document.

Oracle is a is a registered trademark, and Enabling the Information Age is a trademark of Oracle Corporation.

All other company and product names mentioned are used for identification purposes only and may be trademarks of their respective owners.