EricksonLopez.Transaction

dotnet-transaction · Data Access & Transactions

On this page (20 sections)

1. Identity, Tier & Maturity Profile#

L2 Cross-Cutting & ReliabilityStableMaintenance: ActiveAOT: FullMIT LicenseConfidence: HIGH
ApplicationInfrastructurenet8.0net9.0net10.0

2. Value Proposition & Problem Solved#

High-performance, explicit, composable, and Native AOT-ready relational database transaction coordinator for modern .NET 8, .NET 9, and .NET 10 applications.

Repositories opening independent DbConnections cause pool exhaustion and split-brain commits across multi-aggregate application commands.

3. Quick Install#

Primary package: EricksonLopez.Transaction

dotnet add package EricksonLopez.Transaction --version 2.0.0
Also published in this family:
EricksonLopez.Transaction.AbstractionsEricksonLopez.Transaction.PostgreSqlEricksonLopez.Transaction.ResultEricksonLopez.Transaction.MariaDbEricksonLopez.Transaction.OracleEricksonLopez.Transaction.SqlServer

4. Verified Ecosystem Metrics#

v2.0.0
NuGet Published Version
v3.1.0
Repo HEAD Version
3,824
NuGet Downloads
15
Packable Packages
277
Public API Members
3
Benchmark Rows (RyuJIT)

Snapshot retrieved UTC: 2026-12-01

5. When to Use & When Not to Use#

When to use

  • You want ambient AsyncLocal transaction coordination with savepoints, Result-triggered rollbacks, and 6 database dialects.

When NOT to use

  • You only use a single EF Core DbContext SaveChangesAsync call per request without raw ADO.NET/Dapper coordination.

6. Core Capabilities & Design Invariants#

Nested Scope & Savepoint Semantics

Supports UseSavepoint, JoinExisting, RequireNew, and Suppress scopes plus ExecuteResultAsync rollback hooks.

6 Database Providers & Mediator

Native dialects for PostgreSQL, SQL Server, MySQL, MariaDB, Oracle, SQLite, EF Core, and Mediator pipelines.

7. Included NuGet Packages & Adapters#

Package IDStatusNuGet / LocalTFMsAOT StatusDownloadsDescription
EricksonLopez.TransactionPrimaryPublishedv2.0.0 / v3.1.0net8.0, net9.0, net10.0AOT: Full547Native AOT-ready enterprise transaction manager, ambient scope coordinator, state machine, and OpenTelemetry instrumentation for modern .NET.
EricksonLopez.Transaction.AbstractionsPublishedv2.0.0 / v3.1.0net8.0, net9.0, net10.0AOT: Full657Core abstractions, interfaces, options, and primitives for EricksonLopez.Transaction.
EricksonLopez.Transaction.PostgreSqlPublishedv2.0.0 / v3.1.0net8.0, net9.0, net10.0AOT: Full351PostgreSQL provider adapters, error classifiers, and savepoint handlers for EricksonLopez.Transaction.
EricksonLopez.Transaction.ResultPublishedv2.0.0 / v3.1.0net8.0, net9.0, net10.0AOT: Full338Seamless integration between EricksonLopez.Transaction and EricksonLopez.Result monad with automatic failure rollback.
EricksonLopez.Transaction.MariaDbPublishedv2.0.0 / v3.1.0net8.0, net9.0, net10.0AOT: Full288MariaDB connection factory, transaction extensions, and MariaDB error code classifier for EricksonLopez.Transaction using MySqlConnector.
EricksonLopez.Transaction.OraclePublishedv2.0.0 / v3.1.0net8.0, net9.0, net10.0AOT: Full287Oracle Database connection factory, transaction extensions, and Oracle error code classifier for EricksonLopez.Transaction using Oracle.ManagedDataAccess.Core.
EricksonLopez.Transaction.SqlServerPublishedv2.0.0 / v3.1.0net8.0, net9.0, net10.0AOT: Full284Microsoft SQL Server connection factory, transaction extensions, and SQL Server error code classifier for EricksonLopez.Transaction.
EricksonLopez.Transaction.SqlitePublishedv2.0.0 / v3.1.0net8.0, net9.0, net10.0AOT: Full279SQLite connection factory, transaction extensions, and SQLite error code classifier for EricksonLopez.Transaction using Microsoft.Data.Sqlite.
EricksonLopez.Transaction.MySqlPublishedv2.0.0 / v3.1.0net8.0, net9.0, net10.0AOT: Full268MySQL connection factory, transaction extensions, and MySQL error code classifier for EricksonLopez.Transaction using MySqlConnector.
EricksonLopez.Transaction.TestingPublishedv2.0.0 / v3.1.0net8.0, net9.0, net10.0AOT: Full267Testing utilities, fake transaction managers, spy contexts, and chaos simulators for EricksonLopez.Transaction.
EricksonLopez.Transaction.DapperPublishedv2.0.0 / v3.1.0net8.0, net9.0, net10.0AOT: Full258Dapper integration and high-performance CommandDefinition extensions for EricksonLopez.Transaction.
EricksonLopez.Transaction.EntityFrameworkCoreUnpublished— / v3.1.0net10.0AOT: Full0EricksonLopez.Transaction.EntityFrameworkCore module for EricksonLopez.Transaction.
EricksonLopez.Transaction.MediatorUnpublished— / v3.1.0net8.0, net9.0, net10.0AOT: Full0Enterprise mediator pipeline behavior for EricksonLopez.Transaction. Automatically coordinates database transaction lifecycles, committing on success and rolling back on functional failure (Result.IsFailure) or unhandled exceptions.
EricksonLopez.Transaction.ResilienceUnpublished— / v3.1.0net10.0AOT: Full0Polly resilience extensions for handling ambiguous transaction commits.
EricksonLopez.Transaction.AnalyzersAnalyzer / GeneratorUnpublished— / v3.1.0netstandard2.0AOT: N/A (Analyzer/Legacy)0EricksonLopez.Transaction.Analyzers module for EricksonLopez.Transaction.

8. Quick Start Code Example#

Grounded in verified public APIs from EricksonLopez.Transaction. Compile with `<ImplicitUsings>disable</ImplicitUsings>` and explicit imports.

using EricksonLopez.Transaction.Mediator; // Local unpublished 3.1.0 package
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddPostgreSqlTransaction(
    builder.Configuration.GetConnectionString("Postgres")!);
builder.Services.AddTransactionPipelineBehavior(); // Local unpublished 3.1.0 package

9. Architecture & Dependency Flow#

flowchart LR
  lib_transaction["EricksonLopez.Transaction (L2)"]
  lib_result["EricksonLopez.Result (L0)"]
  lib_transaction -.-> lib_result
  lib_mediator["EricksonLopez.Mediator (L2)"]
  lib_transaction --> lib_mediator
EricksonLopez.Transaction Dependency Topology2 upstream library dependencies and 0 downstream dependent libraries verified in dependencies.json.
View accessible text summary and structure

2 upstream library dependencies and 0 downstream dependent libraries verified in dependencies.json.

DirectionLibraryTierRelationship Kinds
UpstreamEricksonLopez.ResultL0Adapter, NuGet Package
UpstreamEricksonLopez.MediatorL2Compile-Time
flowchart LR
  lib_transaction["EricksonLopez.Transaction (L2)"]
  lib_result["EricksonLopez.Result (L0)"]
  lib_transaction -.-> lib_result
  lib_mediator["EricksonLopez.Mediator (L2)"]
  lib_transaction --> lib_mediator

10. Target Frameworks & Native AOT / Trimming Matrix#

MSBuild `.csproj` inspection across 15 packages: 14 Full, 0 Partial, 0 Incompatible, 1 NotApplicable (analyzers/generators).

Package IDIsAotCompatibleEnableTrimAnalyzerVerified AOT StatusTarget Frameworks
EricksonLopez.TransactiontruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Transaction.AbstractionstruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Transaction.PostgreSqltruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Transaction.ResulttruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Transaction.MariaDbtruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Transaction.OracletruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Transaction.SqlServertruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Transaction.SqlitetruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Transaction.MySqltruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Transaction.TestingtruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Transaction.DappertruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Transaction.EntityFrameworkCoretruetrueFullnet10.0
EricksonLopez.Transaction.MediatortruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Transaction.ResiliencetruetrueFullnet10.0
EricksonLopez.Transaction.AnalyzersfalsefalseNotApplicablenetstandard2.0

11. Upstream Dependencies & Downstream Dependents#

Upstream Dependencies (2)

Downstream Dependents (0)

No other EricksonLopez.* libraries currently depend on this family.

12. Optional Adapters & Third-Party Integrations#

Internal Adapter Edges & Integration Packages

Verified External NuGet Dependencies (12)

DapperMicrosoft.Data.SqlClientMicrosoft.Data.SqliteMicrosoft.EntityFrameworkCore.RelationalMicrosoft.Extensions.DependencyInjection.AbstractionsMicrosoft.Extensions.Logging.AbstractionsMicrosoft.Extensions.OptionsMySqlConnectorNpgsqlOpenTelemetry.ApiOracle.ManagedDataAccess.CorePolly

13. Configuration & DI Registration Summary#

Verified DI & Configuration Entry Points

  • DbContextTransactionExtensions.UseTransactionAsync

    Enlists the specified `DbContext` into the active transaction managed by `transactionContext`.

  • TransactionMediatorServiceCollectionExtensions.AddTransactionPipelineBehavior

    Registers the `TransactionPipelineBehavior<TRequest, TResponse>` as an open-generic pipeline behavior.

  • MariaDbTransactionExtensions.AddMariaDbTransaction

    Registers MariaDB database connection factory and transaction manager services.

  • MySqlTransactionExtensions.AddMySqlTransaction

    Registers MySQL database connection factory and transaction manager services.

  • OracleTransactionExtensions.AddOracleTransaction

    Registers Oracle database connection factory and transaction manager services.

  • PostgreSqlTransactionExtensions.AddPostgreSqlTransaction

    Registers PostgreSQL database connection factory and transaction manager services using an `NpgsqlDataSource`.

  • SqlServerTransactionExtensions.AddSqlServerTransaction

    Registers Microsoft SQL Server database connection factory and transaction manager services.

  • SqliteTransactionExtensions.AddSqliteTransaction

    Registers SQLite database connection factory and transaction manager services.

  • TransactionServiceCollectionExtensions.AddTransaction

    Registers transaction coordination services using an asynchronous connection creation delegate.

  • TransactionServiceCollectionExtensions.AddTransaction<TConnectionFactory>

    Registers transaction coordination services using the specified connection factory implementation.

Key Public Types & Contracts

  • EricksonLopez.Transaction.AutonomousTransactionRunner (class)

    Default implementation of `IAutonomousTransactionRunner` that executes critical operations inside an independent physical connection and transaction (`NestedTransactionBehavior.RequireNew`), ensuring durable commits even when an outer ambient transaction rolls back.

  • EricksonLopez.Transaction.DeferredTransactionUnitOfWork (class)

    Scoped unit-of-work coordinator for inspecting and explicitly materializing deferred ambient transactions.

  • EricksonLopez.Transaction.DelegateDbConnectionFactory (class)

    Provides a delegate-based implementation of `IDbConnectionFactory` that wraps caller-supplied factory functions.

  • EricksonLopez.Transaction.IAutonomousTransactionRunner (interface)

    Executes critical durability operations (such as authentication lockout counters, security audit entries, and compromised token-family revocations) on an independent autonomous database connection and transaction whose commit survives even if an enclosing ambient transaction rolls back.

  • EricksonLopez.Transaction.IDatabaseDialect (interface)

    Provides an abstraction over database-specific syntax and behaviors.

  • EricksonLopez.Transaction.IDbConnectionFactory (interface)

    Defines a factory responsible for creating and opening database connections.

  • EricksonLopez.Transaction.IDeferredTransactionContext (interface)

    Extends `ITransactionContext` with non-materializing inspection members and explicit asynchronous connection/transaction materialization for lazy transaction acquisition (`TransactionOptions.DeferAcquisition`).

  • EricksonLopez.Transaction.IDeferredTransactionUnitOfWork (interface)

    Provides explicit control over deferred unit-of-work transaction materialization so handlers can complete external I/O or CPU-intensive pre-flight work before checking out a pooled database connection.

  • EricksonLopez.Transaction.ISavepoint (interface)

    Represents a named savepoint within an active transaction, enabling partial rollback without aborting the outer transaction.

  • EricksonLopez.Transaction.ITransaction (interface)

    Represents an explicit handle to an active database transaction lifecycle.

  • EricksonLopez.Transaction.ITransactionContext (interface)

    Provides access to the active database connection, transaction primitive, state, and savepoints during transactional execution.

  • EricksonLopez.Transaction.ITransactionEnlistment (interface)

    Defines lifecycle hooks for participants enlisting in a transaction boundary.

14. Verified Performance Benchmarks#

All verified measurements below come strictly from `BenchmarkDotNet.Artifacts` running on .NET RyuJIT (0 NativeAOT benchmark runs exist in this snapshot).

Total rows: 3 · Measured: 1 · NA / Error: 2 · Suites: 1

Observed runtimes: .NET 10.0.12 X64 RyuJIT x86-64-v3

Observed CPUs: AMD EPYC 7763 2.45GHz, 1 CPU, 4 logical and 2 physical cores

SuiteMethodRuntimeMean (ns)Allocated (B)Status
TransactionBenchmarksDirectDbTransactionBenchmark.NET 10.0.12 X64 RyuJIT x86-64-v37,4511,690measured

15. Release History & NuGet vs Repo Status#

Version lag detected: NuGet.org latest published version is v2.0.0, while local repository HEAD is at v3.1.0.

VersionSourcePublished DateSummary
v2.0.0 ↗nuget2026-09-24Published EricksonLopez.Transaction 2.0.0 to NuGet.org.
v2.0.0 ↗github2026-09-24[2.0.0](https://github.com/ericksonlopezf/dotnet-transaction/compare/v1.0.0...v2.0.0) (2026-09-24) ⚠ BREAKING CHANGES * add EF Core, Polly resilience, Roslyn analyzer, and pluggable database dialects ✨ Features * add EF Core, Polly resilience, Roslyn analyzer, and pluggable database dialects ([3d1a4e6](https://github.com/ericksonlopezf/dotnet-transaction/commit/3d1a4e6deea4ab5e59004095f8a42180f...
v1.0.0 ↗github2026-08-29Ecosystem Packages in this release | Package | Version | |---------|---------| | `EricksonLopez.Transaction.Abstractions` | `1.0.0` | | `EricksonLopez.Transaction` | `1.0.0` | | `EricksonLopez.Transaction.Dapper` | `1.0.0` | | `EricksonLopez.Transaction.MariaDb` | `1.0.0` | | `EricksonLopez.Transaction.MySql` | `1.0.0` | | `EricksonLopez.Transaction.Oracle` | `1.0.0` | | `EricksonLopez.Transact...
v1.0.0 ↗nuget2026-08-29Published EricksonLopez.Transaction 1.0.0 to NuGet.org.

Libraries in the same tier, architectural layer, or directly paired via dependency edges.

17. Documentation, API Reference & Portal Links#

Per-library conceptual Starlight pages expand in M4; API Reference pages expand in M3.2.

18. Source Repository, License & Contributing#

Released under the MIT License. All assemblies follow EricksonLopez.* build invariants: explicit imports, strong-name signing (`EricksonLopez.snk`), and ASCII author metadata (`Erickson Lopez`).

19. Troubleshooting, Pitfalls & Migration Guidance#

  • Register one published database provider package (e.g. AddPostgreSqlTransaction from EricksonLopez.Transaction.PostgreSql) and optionally AddTransactionPipelineBehavior() from the local unpublished EricksonLopez.Transaction.Mediator (3.1.0) package.
  • Version lag detected: NuGet.org latest published version is v2.0.0, while local repository HEAD is at v3.1.0.

20. Quality & Verification Evidence#

Strong-Name Signing (`EricksonLopez.snk`)
EricksonLopez.snk
`ImplicitUsings=disable`
disable
XML Documentation Extraction
Verified (17 namespaces, 67 types, 277 members)
MSBuild AOT / Trim Attributes
14 Full / 0 Partial / 0 Incompatible / 1 N/A
BenchmarkDotNet Artifacts
3 total (1 measured, 2 na_error)

Explicit Verification Boundaries & Limitations

  • All verified measurements below come strictly from `BenchmarkDotNet.Artifacts` running on .NET RyuJIT (0 NativeAOT benchmark runs exist in this snapshot).
  • 4 unpublished

Search EricksonLopez.* Ecosystem

Type a library name, NuGet package ID, .NET type, or architectural concept to search across the portal.