Transaction Management Overview

Meta Data Services Programming

Meta Data Services Programming

Transaction Management Overview

Transactions can be used to bracket multiple interactions with the repository engine. Changes to a repository that are a result of such interactions are either all committed or all undone, depending on the way that the transaction is completed. Repository methods that write data to a repository can be executed only within a transaction. Methods that read data from a repository can be executed without a transaction (although such reads can be done against partially updated data).

A repository database can have multiple repository instances connected to it simultaneously, from the same or from different processes. Each repository instance can have at most one transaction active at a time.

As a rule, the repository engine never implicitly cancels transactions. If a failure occurs, you must explicitly terminate the transaction. There is one exception to this rule: If you start a transaction, and then release the repository instance to which the transaction belongs, your transaction will be canceled.

Atomicity of Operations

OPT_ATOMICOP_MODE is an IReposOption option that you can set to enable or disable atomicity of operations. If this option is enabled, all operations, except commit, are executed atomically. If this option is disabled, the entire transaction is terminated in cases where an operation fails.

Atomicity of operations creates a backup copy of each row in cache just before an update and restores it in case the operation fails. If the operation is successful, the backup copy is discarded.

The following topics provide more information about defining a transaction.

Topic Description
Managing Transactions Explains the steps used to set up a transaction.
Nesting Transactions Describes the scope and implementation of nesting transactions.
Transactions and Caching Describes caching behavior as it relates to transactions.
Integration with Distributed Transaction Coordinator Explains how to use Microsoft® Distributed Transaction Coordinator (MS DTC), a component of Microsoft SQL Server™ 2000, to coordinate multiple transactions.

See Also

Design Issues and Transaction Management

Managing Transactions and Threads

Repository Objects and Multithreading

IRepositoryTransaction::abort