Table of Contents

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

isolationLevel IsolationLevel

The 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

savepointName string

The name of the savepoint.

cancellationToken CancellationToken

The cancellation token.

Returns

Task

A task representing the asynchronous operation.

ReleaseSavepointAsync(string, CancellationToken)

Releases a savepoint.

Task ReleaseSavepointAsync(string savepointName, CancellationToken cancellationToken)

Parameters

savepointName string

The name of the savepoint.

cancellationToken CancellationToken

The 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

savepointName string

The name of the savepoint.

cancellationToken CancellationToken

The cancellation token.

Returns

Task

A task representing the asynchronous operation.