Every object that runs under the control of MTS also runs in a context. Multiple MTS objects can run in the same context, which among other things makes it possible for them to be parts of the same transaction. Whenever MTS creates an object, it either assigns the object to an existing context or creates a new context for the object. To make it possible for the object to query and use its context, MTS also creates a specific context object for every object it creates. Every MTS object has such a context object.
Through its context object, every MTS object knows which Windows NT account created the object and also which Windows NT account called it. The context object also can tell whether the object is running in a transaction, and if so, it also can tell about the present state of that transaction.
In this chapter's sample code, you'll see calls to the following methods of the context object:
We'll show you in a minute how to code against the context object, but first we'll take a look at the IObjectControl interface.