You can design an application that runs a distributed transaction on Microsoft® SQL Server™ 2000 running on Microsoft Windows® 2000.
Before you use Microsoft Distributed Transaction Coordinator (MS DTC) with a SQL Server 2000 Meta Data Services repository, you must install the Windows 2000 Service Pack 1. This service pack fixes an intermittent bug that causes MS DTC to stop responding when committing changes to a repository database.
The protocol for coordinating transaction atomicity across multiple resource managers is a two-phase commit. The Microsoft facility for a two-phase commit is MS DTC. You can enable distributed transactions to support the following scenarios:
The distributed transaction must be atomic; that is, it must either commit at all resource managers or terminate at all of them. For more information about supporting atomic operations, see Transaction Management Overview.
To support MS DTC in your application, you must set the TXN_USE_DTC transaction flag. IRepositoryTransaction supports the TXN_USE_DTC flag on the GetOption and SetOption methods. The bit value for TXN_USE_DTC is 10. The default value of this option is FALSE. If the value is set to TRUE, each call to IRepositoryTransaction::Begin will create an MS DTC transaction.
IRepositoryTransaction::SetOption(10, 1)
IRepositoryTransaction::Begin
MS DTC requires that the participant who started the transaction be the only party who can call Commit.
If you are a Microsoft Visual C++® programmer, you can use the ITransactionJoin::JoinTransaction method. You can use this method to cause a repository instance that is not currently running a transaction to become part of an existing MS DTC transaction. The active MS DTC transaction object is passed in as an input argument. For more information about the ITransactionJoin interface, see SQL Server Books Online.
Microsoft Visual Basic® applications must use the following API to enlist an MS DTC transaction:
HRESULT IRepositoryTransaction2::JoinTransaction ([in]VARIANT sVArTxn);
where sVArTxn is an IUnknown pointer to the distributed transaction coordinator.
IRepositoryTransaction::commit
IRepositoryTransaction::getOption