Calls to DtcGetTransactionManagerEx can specify a server host name to serve as the transaction commit coordinator in the pszHost parameter. However, the parameter is taken into consideration only if the machine is set to use the local transaction coordinator. If the machine is not set to use the local transaction coordinator, or if a value of NULL is supplied, the following rules determine where the transaction is started and coordinated:
-
If the workstation making the call has a locally installed DTC, the local DTC is used.
-
If the workstation making the call is a Windows 95 computer or a Windows computer that does not have a local DTC installed, the default DTC is used. The default DTC is specified as the Remote Host field on the MSDTC tab of the Component Services administrative tool.
The DtcGetTransactionManagerEx function helps reduce the boot time and minimize resource consumption. The function also adds the ability to demand start DTC to compensate for removing boot start. In general, clients of DTC call this function DTC is not running. It demand starts the transaction manager (TM) for the caller. The caller specify OLE_TM_FLAG_NODEMANDSTART to explicitly disable demand start. The semantics for demand start are as follows:
-
Calls into DtcGetTransactionManagerEx will demand start the TM if required. DtcGetTransactionManagerEx can still return XACT_E_TM_NOTAVAILABLE.
-
This behavior is the same for local and remote clients.
-
If clients want to restart DTC without shutting down and restarting their executables, they should release all references and call on DtcGetTransactionManagerEx again.