Export (0) Print
Expand All

OLE DB Transactions (SQL Server Compact)

Transactions let you group a series of changes to a database in one atomic operation.

A transaction is started by using ITransactionLocal::StartTransaction. After changes have been made to the database, these changes can be committed by using ITransactionLocal::Commit or aborted by using ITransactionLocal::Abort.

Because using transactions in SQL Server Compact 4.0 differs somewhat from that of Microsoft SQL Server, you must consider the following provider-specific issues:

  • The ITransactionJoin interface is not supported because this interface requires that a provider be able to support two-phased commit transactions.

  • SQL Server Compact 4.0 does not support nested transactions.

  • SQL Server Compact 4.0 holds an exclusive lock on a table that has been modified in a transaction until that transaction finishes. This means that the value of DBPROP_SUPPORTEDTXNDDL property is always DBPROPVAL_TC_ALL.

For more information, see Transactions (SQL Server Compact 3.5) and How to: Use Transactions with OLE DB (Programmatically).

© 2015 Microsoft