Microsoft Transaction Server provides a runtime environment for COM components. Although
ActiveX component development in Visual Basic provides a developer with the means to implement
business logic, it does not deal with the issue of scalability and other enterprise issues.
The features of MTS help to take this concern away from the developer. MTS is an option for
deploying ActiveX business components in the enterprise.
First, it allows multiple components to share critical system resources such as ODBC
connections. This is advantageous for organizations that have applications with large numbers of
existing users or expectations for growth in the user base. The number of available database
connections is a classic obstacle to enterprise developers. A properly designed MTS application
can greatly reduce and sometimes even eliminate this concern.
This is not the only way in which MTS increases the efficiency of resource usage.
In a distributed environment, it is quite possible that the business components may be running
on a separate machine.
As the number of users of the application increases, so does the number of
instances of that component. It is not difficult to see how a middle-tier component can become
a resource hog. MTS solves this problem by running the component in process while efficiently keeping
track of client specific instance data internally. In other words, overhead is reduced because
MTS internally separates the object’s runtime code from property values that might
be different from one client to another.
MTS provides a simple method for releasing the resources associated with property
values when they are no longer needed without destroying the object. This is very useful because
an object that will be reused by a client does not have to be created and destroyed many times
over the life of the application—a potentially expensive operation. The concern of inefficient
memory usage associated with keeping an instance of an object alive for a long period of time
is virtually non-existent.
MTS, as the name implies, also has built-in support for transactions. MTS components
can automatically include any activity on a database connection in a transaction. When an
MTS component completes its work, it can commit the transaction automatically or roll it back
if there is an error. This feature is part of the MTS infrastructure, so adding transaction
support is an issue of MTS configuration rather than a coding task for the developer.
Finally, MTS simplifies the deployment of a multitier application. MTS allows
you to create a single executable intended to run on the client machine that properly
registers all the necessary type library information needed to call your MTS component.
Additionally, it automatically handles the details of client-side DCOM configuration
for you. Anyone who has experienced the problem of tracking down the registry
entries and related problems with COM components, especially when they are implemented
in a DCOM environment, will immediately see the value of MTS.