Distributed Transactions

OLE DB Programmer's Reference

A distributed transaction is a transaction that updates data on two or more networked computer systems. If the provider supports distributed transactions, it exposes ITransactionJoin on the session. To determine whether the provider supports distributed transactions, the consumer calls QueryInterface to request an ITransactionJoin interface pointer on the session object. The consumer calls JoinTransaction on this interface pointer to enlist the session in a distributed transaction. After the consumer has joined a distributed transaction, it uses the ITransaction interface of the transaction coordinator to commit or abort the transaction. Consumers must set fRetaining to FALSE when committing or aborting a coordinated transaction. Following the commit or abort, ITransaction becomes invalid and the session is no longer part of a coordinated transaction.

It is an error to call ITransactionJoin::JoinTransaction if the session is already enlisted in a local transaction. In addition, the provider might require that any existing distributed transactions be committed or aborted before enlisting in a new distributed transaction. To unenlist from the transaction, the consumer calls ITransactionJoin::JoinTransaction on the session with pUnkTransactionCoord set to NULL.

If the consumer calls ITransactionLocal::StartTransaction to begin a local transaction while in a distributed transaction, that new transaction acts as a nested transaction within the distributed transaction. This is not supported by most providers.

1998-2001 Microsoft Corporation. All rights reserved.



Microsoft Ole Db 2.0 Programmer's Reference and Data Access SDK
Microsoft OLE DB 2.0 Programmers Reference and Data Access SDK (Microsoft Professional Editions)
ISBN: 0735605904
EAN: 2147483647
Year: 1998
Pages: 1083

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net