Class KafkaTransactionManager
- Namespace
- MASES.EntityFrameworkCore.KNet.Storage.Internal
- Assembly
- MASES.EntityFrameworkCore.KNet.dll
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.
public class KafkaTransactionManager : IDbContextTransactionManager, IResettableService, ITransactionEnlistmentManager
- Inheritance
-
KafkaTransactionManager
- Implements
- Inherited Members
Constructors
KafkaTransactionManager(IDiagnosticsLogger<Transaction>)
Default initializer
public KafkaTransactionManager(IDiagnosticsLogger<DbLoggerCategory.Database.Transaction> logger)
Parameters
Properties
CurrentTransaction
Gets the current transaction.
public virtual IDbContextTransaction? CurrentTransaction { get; }
Property Value
EnlistedTransaction
The currently enlisted transaction.
public virtual Transaction? EnlistedTransaction { get; }
Property Value
Methods
BeginTransaction()
Begins a new transaction.
public virtual IDbContextTransaction BeginTransaction()
Returns
- IDbContextTransaction
The newly created transaction.
BeginTransactionAsync(CancellationToken)
Asynchronously begins a new transaction.
public virtual Task<IDbContextTransaction> BeginTransactionAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for the task to complete.
Returns
- Task<IDbContextTransaction>
A task that represents the asynchronous operation. The task result contains the newly created transaction.
Exceptions
- OperationCanceledException
If the CancellationToken is canceled.
CommitTransaction()
Commits all changes made to the database in the current transaction.
public virtual void CommitTransaction()
CommitTransactionAsync(CancellationToken)
Commits all changes made to the database in the current transaction.
public virtual Task CommitTransactionAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for the task to complete.
Returns
- Task
A task that represents the asynchronous operation.
Exceptions
- OperationCanceledException
If the CancellationToken is canceled.
EnlistTransaction(Transaction?)
Specifies an existing Transaction to be used for database operations.
public virtual void EnlistTransaction(Transaction? transaction)
Parameters
transaction
TransactionThe transaction to be used.
ResetState()
Resets the service so that it can be used from the pool.
public virtual void ResetState()
ResetStateAsync(CancellationToken)
Resets the service so that it can be used from the pool.
public virtual Task ResetStateAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for the task to complete.
Returns
- Task
A task that represents the asynchronous operation.
Exceptions
- OperationCanceledException
If the CancellationToken is canceled.
RollbackTransaction()
Discards all changes made to the database in the current transaction.
public virtual void RollbackTransaction()
RollbackTransactionAsync(CancellationToken)
Discards all changes made to the database in the current transaction.
public virtual Task RollbackTransactionAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenA CancellationToken to observe while waiting for the task to complete.
Returns
- Task
A task that represents the asynchronous operation.
Exceptions
- OperationCanceledException
If the CancellationToken is canceled.