Performing Transactions in ADOMD.NET
Applies To: SQL Server 2016 Preview
In ADOMD.NET, you use the AdomdTransaction object to manage transaction context for a given AdomdConnection object. This functionality allows you to run several commands within the same context. Each command will read the same data without the read data changing between each command execution.
The AdomdTransaction class is the implementation of the System.Data.IDbTransaction interface, part of the Microsoft .NET Framework Class Library and implemented by all .NET Framework data providers that support transactions.
The AdomdTransaction object only supports read-committed transactions, in which shared locks are held while the data is being read to avoid dirty reads.
The AdomdConnection is used to start the transaction. To use the transaction, commands are then run against the connection that started the transaction. When you are finished with the transaction, you can either be roll back or commit the transaction.
You create an instance of an AdomdTransaction object by calling the BeginTransaction method of the AdomdConnection object. The following example shows how to create an instance of the AdomdTransaction object:
Dim objTransaction As AdomdTransaction = objConnection.BeginTransaction() AdomdTransaction objTransaction = objConnection.BeginTransaction();