Show / Hide Table of Contents

Class NpgsqlTransaction

Represents a transaction to be made in a PostgreSQL database. This class cannot be inherited.

Inheritance
System.Object
NpgsqlTransaction
Namespace: Npgsql
Assembly: Npgsql.dll
Syntax
public sealed class NpgsqlTransaction : DbTransaction

Properties

Connection

Specifies the NpgsqlConnection object associated with the transaction.

Declaration
public NpgsqlConnection Connection { get; }
Property Value
Type Description
NpgsqlConnection

The NpgsqlConnection object associated with the transaction.

DbConnection

Specifies the NpgsqlConnection object associated with the transaction.

Declaration
protected override DbConnection DbConnection { get; }
Property Value
Type Description
DbConnection

The NpgsqlConnection object associated with the transaction.

IsCompleted

Specifies the completion state of the transaction.

Declaration
public bool IsCompleted { get; }
Property Value
Type Description
System.Boolean

The completion state of the transaction.

IsolationLevel

Specifies the IsolationLevel for this transaction.

Declaration
public override IsolationLevel IsolationLevel { get; }
Property Value
Type Description
IsolationLevel

The IsolationLevel for this transaction. The default is ReadCommitted.

Methods

Commit()

Commits the database transaction.

Declaration
public override void Commit()

CommitAsync()

Commits the database transaction.

Declaration
public Task CommitAsync()
Returns
Type Description
Task

CommitAsync(CancellationToken)

Commits the database transaction.

Declaration
public Task CommitAsync(CancellationToken cancellationToken)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task

Dispose(Boolean)

Dispose.

Declaration
protected override void Dispose(bool disposing)
Parameters
Type Name Description
System.Boolean disposing

Release(String)

Rolls back a transaction from a pending savepoint state.

Declaration
public void Release(string name)
Parameters
Type Name Description
System.String name

Rollback()

Rolls back a transaction from a pending state.

Declaration
public override void Rollback()

Rollback(String)

Rolls back a transaction from a pending savepoint state.

Declaration
public void Rollback(string name)
Parameters
Type Name Description
System.String name

RollbackAsync()

Rolls back a transaction from a pending state.

Declaration
public Task RollbackAsync()
Returns
Type Description
Task

RollbackAsync(CancellationToken)

Rolls back a transaction from a pending state.

Declaration
public Task RollbackAsync(CancellationToken cancellationToken)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task

Save(String)

Creates a transaction save point.

Declaration
public void Save(string name)
Parameters
Type Name Description
System.String name
Back to top Copyright © 2015-2017 Microsoft
Generated by DocFX