The MTS run-time environment provides a number of services to components and applications that are executed within it. These services are controlled and managed by MTS, thus alleviating the programming from having to worry about these. This allows the developer to focus on solving the business problem at hand, rather than worrying about how to build all of the transactional plumbing.
The MTS run-time environment automatically provides support for distributed transactions. As we described earlier, a transaction is an atomic unit of work that either succeeds or fails as a whole. By allowing a transaction to be distributed, the different components that make up the pieces of the transaction can be executed on physically separate systems. For example, a single transaction could consist of a component running on system A, performing database transaction with a SQL server on machine B. Then, another component in the transaction could be running on machine C, which performs database transactions on an Oracle server running on machine D. These four boxes, running four distinct pieces of code, can all participate in the same transaction.
The run-time environment will automatically manage all of the processes and threads for components executing within MTS. This frees the developer from having to worry about in what process or on what thread their components are executed.
Later in this chapter, we will look at what threads are and the different threading models that are available to components that will run within MTS.
By providing object instance management for components executing within the run-time environment, MTS can efficiently use resources in the system. Though not fully supported in this release, MTS will be able to reuse objects, rather than having to create and initialize them every time they are used. All that developers need to do to support this is to provide a method for resetting any state within the object when its method is complete. This will be covered later in this chapter.
A resource manager is a part of a database server that works with Transaction Server to manages durable data. Durable data is defined as data that will survive a system failure. Typically, a resource manager provides the database access functionality to the component running inside of MTS. SQL Server and Oracle are examples of database servers that also provide resource managers. The resource manager works with the transaction to support the ACID properties, as well as automating the process of rollback.