Interface ITransactionScopeAdvanced
- Namespace
- Excalibur.Data.Persistence
- Assembly
- Excalibur.Data.Abstractions.dll
Provides advanced transaction scope capabilities including savepoints and nested scopes.
public interface ITransactionScopeAdvanced
Remarks
This is an ISP sub-interface of ITransactionScope. Not all providers support
savepoints or nested transactions. Consumers should check for this interface via pattern
matching: if (scope is ITransactionScopeAdvanced advanced) { ... }
Providers that do not support these capabilities (e.g., InMemory, Redis, MongoDB) should not implement this interface rather than throwing NotSupportedException.
Methods
CreateNestedScope(IsolationLevel)
Creates a nested transaction scope.
ITransactionScope CreateNestedScope(IsolationLevel isolationLevel = IsolationLevel.ReadCommitted)
Parameters
isolationLevelIsolationLevelThe isolation level for the nested scope.
Returns
- ITransactionScope
The nested transaction scope.
CreateSavepointAsync(string, CancellationToken)
Creates a savepoint in the transaction.
Task CreateSavepointAsync(string savepointName, CancellationToken cancellationToken)
Parameters
savepointNamestringThe name of the savepoint.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- Task
A task representing the asynchronous operation.
ReleaseSavepointAsync(string, CancellationToken)
Releases a savepoint.
Task ReleaseSavepointAsync(string savepointName, CancellationToken cancellationToken)
Parameters
savepointNamestringThe name of the savepoint.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- Task
A task representing the asynchronous operation.
RollbackToSavepointAsync(string, CancellationToken)
Rolls back to a specific savepoint.
Task RollbackToSavepointAsync(string savepointName, CancellationToken cancellationToken)
Parameters
savepointNamestringThe name of the savepoint.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- Task
A task representing the asynchronous operation.