Details
It is better to think about MTS as Microsoft Component Server or Manager. Microsoft admitted that MTS name is not the best for a set of technologies that manage operations with more then one COM-component. MTS addresses situations when several components execute something independently and result should be successful only if all components involved in transaction signal successful result. If some component gives false result, a system must return to initial state as if nothing happend. First thing that MTS addresses is transactional support. If you don't need transactional support then you most likely don't need MTS. The second problem that MTS concened is resource management. When you have 1000 concurrent users your COM-object would create new databese connection, new process, new threads, other resources for each new user. It is tremendous waste of system resources on server. While it is possible to avoid this problem programmatically, MTS does the job for you. If you planning to have less then 100 concurrent users your server would not slow down in most situation and you can avoid using MTS. In particular, MTS addresses dozens of different issues besides transactional support and resource management. In particular, MTS allows you to set permissions, called roles, on methods and interface level not doing any programming at all. Summary: three basic services that MTS provides are transactional support, resource management and security service.
Details
MTS operates MTS-specific ObjectContext Object instead of direct invokation of a custom
object. Custom object is created in context of ObjectContext object. COM-object being
instaled under MTS has no longer exists as independent entity. Registry settings for
an object are changed by Component Service. Now InProcServer32 value under HKEY_CLASSES_ROOT
specifing path to COM-object DLL has a path to MTS Executive mtsex.dll. When MTS-object
called, ContextObject created at first and then a custom COM-object created inside that
context by:
GetObjectContext.CreateInstance(<object ProgID>)
Details
COM-object must be in process DLL. This is the first requirement. Additionally MTS 3.0 running under Windows 2000 sets a limit of 1024 methods per interface that an object can have ( MTS 2.0 version had a 100 limit ).
Details
When working on Windows 2000 platform, MTS is preinstalled with the OS. To open MTS Explorer, go Start Menu/Settings/Control Panel/Administrative Tools/Component Services. Windows NT 4.0 Workstation or Server does not come with MTS. Use CD with Windows NT Options Pack to install MTS. Option Pack has MTS 2.0 version that comes with useful MST samples Bank, Tic and Toe. How to work with the samples explained in MTS.CHM file of MSDN 6.0. MTS 3.0 of Windows 2K does not come with samples.
Details
Let's consider simple MTS application with two objects. Before packaging to MTS
DLL was build in VB 6.0 with two classes that would be an objects
when instantiated. One object calls another object. Prototype for a first class is:
Function <functionname>(<parameters>)
On Error GoTo <labelname>
GetObjectContext.CreateInstance("<DLL project name>.<classname>")
GetObjectContext.SetComplete
<labelname>:
GetObjectContext.SetAbort
End Function
For a second class:
Function <functionname>(<parameters>)
On Error GoTo <labelname>
GetObjectContext.SetComplete
<labelname>:
GetObjectContext.SetAbort
End Function
Details
Open MTS Explorer, create an empty package, open the package. Drag-and-drop DLL from Windows Explorer to the MTS Explorer.
Details
Delete old version from MTS. Install new version as if it's a new component.
© (c) 2001, Stanislav Malevanny