MDAC 2.5 SDK - OLE DB Programmer's Reference
Chapter 1: Overview of OLE DB


 

Local Transactions

Local transactions refer to transactions running in the context of a resource manager. A provider that supports transactions exposes ITransactionLocal on the session. A call to ITransactionLocal::StartTransaction begins a transaction on the session. A session can be inside or outside of a transaction at any time. When created, a session is outside of a transaction and all the work done under the scope of the session is immediately committed on each OLE DB method call. When a session enters a local or coordinated transaction, all the work done under the session—between the ITransactionLocal::StartTransaction and ITransaction::Commit or ITransaction::Abort method calls and including other objects created underneath it (commands or rowsets)—is part of the transaction.

StartTransaction supports various isolation levels that consumers can request when creating a transaction. OLE DB providers do not need to support all possible transaction options defined. A consumer can interrogate the transaction capabilities of a provider through IDBProperties.

For providers that support nested transactions, calling StartTransaction within an existing transaction begins a new nested transaction below the current transaction. Calling ITransaction::Commit or ITransaction::Abort on the session commits or aborts, respectively, the transaction at the lowest level.