Table of Contents

Class DataConnectionTransaction

Namespace
LinqToDB.Data
Assembly
linq2db.dll

Data connection transaction controller.

public class DataConnectionTransaction : IDisposable, IAsyncDisposable
Inheritance
DataConnectionTransaction
Implements
Extension Methods

Constructors

DataConnectionTransaction(DataConnection)

Creates new transaction controller for data connection.

public DataConnectionTransaction(DataConnection dataConnection)

Parameters

dataConnection DataConnection

Data connection instance.

Properties

DataConnection

Returns associated data connection instance.

public DataConnection DataConnection { get; }

Property Value

DataConnection

Methods

Commit()

Commits current transaction for data connection.

public void Commit()

CommitAsync(CancellationToken)

Commits current transaction for data connection asynchonously. If underlying provider doesn't support asynchonous commit, it will be performed synchonously.

public Task CommitAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Asynchronous operation cancellation token.

Returns

Task

Asynchronous operation completion task.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

DisposeAsync()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.

public Task DisposeAsync()

Returns

Task

Rollback()

Rolllbacks current transaction for data connection.

public void Rollback()

RollbackAsync(CancellationToken)

Rollbacks current transaction for data connection asynchonously. If underlying provider doesn't support asynchonous rollback, it will be performed synchonously.

public Task RollbackAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Asynchronous operation cancellation token.

Returns

Task

Asynchronous operation completion task.