Class NpgsqlTransaction
Represents a transaction to be made in a PostgreSQL database. This class cannot be inherited.
Inheritance
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
Declaration
public override IsolationLevel IsolationLevel { get; }
Property Value
Type | Description |
---|---|
IsolationLevel | The |
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 |