Simple Transactions

OLE DB Programmer's Reference

At any point in its lifetime, a session can be inside or outside a transaction. When created, a session is outside a transaction and all work done within the scope of that session and that is visible to the data store is immediately committed on each method call. (This is sometimes referred to as auto-commit mode or implicit mode.) When a session enters a transaction, all work done within the scope of that session and that is visible to the data store is part of that transaction and is committed or aborted as a single unit. (This is sometimes referred to as manual-commit mode.)

When the consumer calls ITransactionLocal::StartTransaction, a new local transaction is started. If there is already an active transaction on the session, the new transaction is started as a nested transaction below the current transaction. If the provider does not support nested transactions, calling StartTransaction when there is already an active transaction on the session returns XACT_E_XTIONEXISTS.

The transaction ends when the consumer calls ITransaction::Commit or ITransaction::Abort, at which time all changes to the rowset that have been transmitted to the data store are committed or aborted.

A single data source object can create multiple session objects, each of which can be inside or outside the scope of a transaction at any time.

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