Interface IDatabaseTransaction
Represents a transaction to be made with a database.
Namespace: Venflow
Assembly: Venflow.dll
Syntax
public interface IDatabaseTransaction : IAsyncDisposable, IDisposable
Methods
| Improve this Doc View SourceCommit()
Commits the database transaction.
Declaration
void Commit()
CommitAsync(CancellationToken)
Commits the database transaction.
Declaration
Task CommitAsync(CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | An optional token to cancel the asynchronous operation. |
Returns
Type | Description |
---|---|
Task |
GetNpgsqlTransaction()
Will return the underlying
Declaration
NpgsqlTransaction GetNpgsqlTransaction()
Returns
Type | Description |
---|---|
NpgsqlTransaction | The underlying |
Remarks
Please do note, that if you call any of the Dispose methods on the
Release(String)
Releases a transaction from a pending savepoint state.
Declaration
void Release(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the savepoint. |
ReleaseAsync(String, CancellationToken)
Releases a transaction from a pending savepoint state.
Declaration
Task ReleaseAsync(string name, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the savepoint. |
CancellationToken | cancellationToken | An optional token to cancel the asynchronous operation. |
Returns
Type | Description |
---|---|
Task |
Rollback()
Rolls back a transaction from a pending state.
Declaration
void Rollback()
Rollback(String)
Rolls back a transaction from a pending savepoint state.
Declaration
void Rollback(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the savepoint. |
RollbackAsync(CancellationToken)
Rolls back a transaction from a pending state.
Declaration
Task RollbackAsync(CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | An optional token to cancel the asynchronous operation. |
Returns
Type | Description |
---|---|
Task |
RollbackAsync(String, CancellationToken)
Rolls back a transaction from a pending savepoint state.
Declaration
Task RollbackAsync(string name, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the savepoint. |
CancellationToken | cancellationToken | An optional token to cancel the asynchronous operation. |
Returns
Type | Description |
---|---|
Task |
Save(String)
Creates a transaction save point.
Declaration
void Save(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the savepoint. |
Remarks
This method does not cause a database roundtrip to be made. The savepoint creation statement will instead be sent along with the next command.
SaveAsync(String, CancellationToken)
Creates a transaction save point.
Declaration
Task SaveAsync(string name, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the savepoint. |
CancellationToken | cancellationToken | An optional token to cancel the asynchronous operation. |
Returns
Type | Description |
---|---|
Task |
Remarks
This method does not cause a database roundtrip to be made, and will therefore always complete synchronously. The savepoint creation statement will instead be sent along with the next command.