MTS Application Programming Interface

In addition to providing a run-time environment for execution and a user interface for management, MTS provides an application programming interfaces (APIs) for creating MTS-aware components and applications. The APIs can be used to create clients that can access MTS components. They can also be used to create COM objects that can execute within the MTS run-time environment.

MTS makes every effort to be as transparent as possible to those applications that will utilize the services it provides. All that an application that wishes to use a transactional component needs to do is call the same COM function to create the object as it would for a normal, non-MTS component. This allows an application to be migrated from a standard environment to an MTS environment without any modification to the application itself. The underlying layers of COM will handle all of the support necessary.

For developing components that will execute within MTS, there is a set of COM Interfaces that the component can support. (COM interfaces were described in Chapter 1) These interfaces are used by the component to communicate with MTS. They allow the component to:

  • Declare that an object's work is complete, if the component has completed its work successfully.  The COM Interface allows the component to communicate with MTS to relay this information.

  • Prevent a transaction from being committed if the component encountered an error or some other reason that prevented it from successfully completing.

  • Create other objects that will execute within the Transaction Server environment.

  • Include other objects' work within the scope of the current object's transaction

The final part of the MTS application programming interfaces supports the creation of applications that will automatically manage the packages and components inside of MTS. This API replicates the functionality provided by MTS Explorer. By taking advantage of these APIs in their applications, developers can ensure that MTS is properly configured to support their packages and components.

© 1998 by Wrox Press. All rights reserved.