Storage Objects and Transactions

OLE DB Programmer's Reference

Whether storage objects are transacted depends on the DBPROP_TRANSACTEDOBJECT property, which can be set on a per-column basis. If the value of this property is VARIANT_TRUE, any storage object created on the column is transacted. That is, when a consumer calls ITransaction::Commit and the provider commits all data visible to the rowset, this includes data made visible to the rowset through storage objects. When a consumer calls ITransaction::Abort and the provider rolls back all data visible to the rowset, this includes data made visible to the rowset through storage objects. For information about what data in storage objects is visible to the rowset, see "Storage Objects and Rowset Update Semantics," earlier in this chapter.

Whether uncommitted data in transacted storage objects remains valid and whether the storage objects themselves remain valid when the transaction is committed or aborted depend on the retaining flag (fRetaining) used in the call to ITransaction::Commit or ITransaction::Abort. The retaining flag set to TRUE implicitly begins a new unit of work. If a commit is retaining, the storage objects and any uncommitted data in them remain valid. If an abort is retaining, the storage objects remain valid but any uncommitted data in them is lost; furthermore, the provider must synchronize the object with its state in the data store after the transaction was aborted there. If the rowset is not preserved after a commit or abort, the storage objects enter zombie states and any uncommitted data in them is lost. The consumer can only call Release on such objects. All other methods return E_UNEXPECTED. Whether the rowset is preserved depends on the DBPROP_COMMITPRESERVE and DBPROP_ABORTPRESERVE properties. For more information on committing and aborting a transaction, see "ITransactionObject" in Chapter 15: Transactions.

If the value of DBPROP_TRANSACTEDOBJECT is VARIANT_FALSE, any storage object created on the column is not transacted. That is, all changes to the storage object are permanent once they are made visible in the data store. Calling ITransaction::Commit or ITransaction::Abort on a session containing a rowset with nontransacted storage objects should not affect the state of the storage object.

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