EricksonLopez.Transaction
dotnet-transaction · Data Access & Transactions
On this page (20 sections)
1. Identity, Tier & Maturity Profile#
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<PackageReference Include="EricksonLopez.Transaction" Version="2.0.0" /><PackageVersion Include="EricksonLopez.Transaction" Version="2.0.0" />4. Verified Ecosystem Metrics#
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 ID | Status | NuGet / Local | TFMs | AOT Status | Downloads | Description |
|---|---|---|---|---|---|---|
| EricksonLopez.TransactionPrimary | Published | v2.0.0 / v3.1.0 | net8.0, net9.0, net10.0 | AOT: Full | 547 | Native AOT-ready enterprise transaction manager, ambient scope coordinator, state machine, and OpenTelemetry instrumentation for modern .NET. |
| EricksonLopez.Transaction.Abstractions | Published | v2.0.0 / v3.1.0 | net8.0, net9.0, net10.0 | AOT: Full | 657 | Core abstractions, interfaces, options, and primitives for EricksonLopez.Transaction. |
| EricksonLopez.Transaction.PostgreSql | Published | v2.0.0 / v3.1.0 | net8.0, net9.0, net10.0 | AOT: Full | 351 | PostgreSQL provider adapters, error classifiers, and savepoint handlers for EricksonLopez.Transaction. |
| EricksonLopez.Transaction.Result | Published | v2.0.0 / v3.1.0 | net8.0, net9.0, net10.0 | AOT: Full | 338 | Seamless integration between EricksonLopez.Transaction and EricksonLopez.Result monad with automatic failure rollback. |
| EricksonLopez.Transaction.MariaDb | Published | v2.0.0 / v3.1.0 | net8.0, net9.0, net10.0 | AOT: Full | 288 | MariaDB connection factory, transaction extensions, and MariaDB error code classifier for EricksonLopez.Transaction using MySqlConnector. |
| EricksonLopez.Transaction.Oracle | Published | v2.0.0 / v3.1.0 | net8.0, net9.0, net10.0 | AOT: Full | 287 | Oracle Database connection factory, transaction extensions, and Oracle error code classifier for EricksonLopez.Transaction using Oracle.ManagedDataAccess.Core. |
| EricksonLopez.Transaction.SqlServer | Published | v2.0.0 / v3.1.0 | net8.0, net9.0, net10.0 | AOT: Full | 284 | Microsoft SQL Server connection factory, transaction extensions, and SQL Server error code classifier for EricksonLopez.Transaction. |
| EricksonLopez.Transaction.Sqlite | Published | v2.0.0 / v3.1.0 | net8.0, net9.0, net10.0 | AOT: Full | 279 | SQLite connection factory, transaction extensions, and SQLite error code classifier for EricksonLopez.Transaction using Microsoft.Data.Sqlite. |
| EricksonLopez.Transaction.MySql | Published | v2.0.0 / v3.1.0 | net8.0, net9.0, net10.0 | AOT: Full | 268 | MySQL connection factory, transaction extensions, and MySQL error code classifier for EricksonLopez.Transaction using MySqlConnector. |
| EricksonLopez.Transaction.Testing | Published | v2.0.0 / v3.1.0 | net8.0, net9.0, net10.0 | AOT: Full | 267 | Testing utilities, fake transaction managers, spy contexts, and chaos simulators for EricksonLopez.Transaction. |
| EricksonLopez.Transaction.Dapper | Published | v2.0.0 / v3.1.0 | net8.0, net9.0, net10.0 | AOT: Full | 258 | Dapper integration and high-performance CommandDefinition extensions for EricksonLopez.Transaction. |
| EricksonLopez.Transaction.EntityFrameworkCore | Unpublished | — / v3.1.0 | net10.0 | AOT: Full | 0 | EricksonLopez.Transaction.EntityFrameworkCore module for EricksonLopez.Transaction. |
| EricksonLopez.Transaction.Mediator | Unpublished | — / v3.1.0 | net8.0, net9.0, net10.0 | AOT: Full | 0 | Enterprise 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.Resilience | Unpublished | — / v3.1.0 | net10.0 | AOT: Full | 0 | Polly resilience extensions for handling ambiguous transaction commits. |
| EricksonLopez.Transaction.AnalyzersAnalyzer / Generator | Unpublished | — / v3.1.0 | netstandard2.0 | AOT: N/A (Analyzer/Legacy) | 0 | EricksonLopez.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 package9. Architecture & Dependency Flow#
Rendering diagram…
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
View accessible text summary and structure
2 upstream library dependencies and 0 downstream dependent libraries verified in dependencies.json.
| Direction | Library | Tier | Relationship Kinds |
|---|---|---|---|
| Upstream | EricksonLopez.Result | L0 | Adapter, NuGet Package |
| Upstream | EricksonLopez.Mediator | L2 | Compile-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_mediator10. Target Frameworks & Native AOT / Trimming Matrix#
MSBuild `.csproj` inspection across 15 packages: 14 Full, 0 Partial, 0 Incompatible, 1 NotApplicable (analyzers/generators).
| Package ID | IsAotCompatible | EnableTrimAnalyzer | Verified AOT Status | Target Frameworks |
|---|---|---|---|---|
| EricksonLopez.Transaction | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Transaction.Abstractions | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Transaction.PostgreSql | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Transaction.Result | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Transaction.MariaDb | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Transaction.Oracle | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Transaction.SqlServer | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Transaction.Sqlite | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Transaction.MySql | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Transaction.Testing | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Transaction.Dapper | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Transaction.EntityFrameworkCore | true | true | Full | net10.0 |
| EricksonLopez.Transaction.Mediator | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Transaction.Resilience | true | true | Full | net10.0 |
| EricksonLopez.Transaction.Analyzers | false | false | NotApplicable | netstandard2.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
- EricksonLopez.Transaction.Mediator→ EricksonLopez.Result (EricksonLopez.Result)
- EricksonLopez.Transaction.Result→ EricksonLopez.Result (EricksonLopez.Result)
Verified External NuGet Dependencies (12)
13. Configuration & DI Registration Summary#
Verified DI & Configuration Entry Points
DbContextTransactionExtensions.UseTransactionAsyncEnlists the specified `DbContext` into the active transaction managed by `transactionContext`.
TransactionMediatorServiceCollectionExtensions.AddTransactionPipelineBehaviorRegisters the `TransactionPipelineBehavior<TRequest, TResponse>` as an open-generic pipeline behavior.
MariaDbTransactionExtensions.AddMariaDbTransactionRegisters MariaDB database connection factory and transaction manager services.
MySqlTransactionExtensions.AddMySqlTransactionRegisters MySQL database connection factory and transaction manager services.
OracleTransactionExtensions.AddOracleTransactionRegisters Oracle database connection factory and transaction manager services.
PostgreSqlTransactionExtensions.AddPostgreSqlTransactionRegisters PostgreSQL database connection factory and transaction manager services using an `NpgsqlDataSource`.
SqlServerTransactionExtensions.AddSqlServerTransactionRegisters Microsoft SQL Server database connection factory and transaction manager services.
SqliteTransactionExtensions.AddSqliteTransactionRegisters SQLite database connection factory and transaction manager services.
TransactionServiceCollectionExtensions.AddTransactionRegisters 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).
| Suite | Method | Runtime | Mean (ns) | Allocated (B) | Status |
|---|---|---|---|---|---|
| TransactionBenchmarks | DirectDbTransactionBenchmark | .NET 10.0.12 X64 RyuJIT x86-64-v3 | 7,451 | 1,690 | measured |
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.
| Version | Source | Published Date | Summary |
|---|---|---|---|
| v2.0.0 ↗ | nuget | 2026-09-24 | Published EricksonLopez.Transaction 2.0.0 to NuGet.org. |
| v2.0.0 ↗ | github | 2026-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 ↗ | github | 2026-08-29 | Ecosystem 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 ↗ | nuget | 2026-08-29 | Published EricksonLopez.Transaction 1.0.0 to NuGet.org. |
16. Complementary & Related Libraries#
Libraries in the same tier, architectural layer, or directly paired via dependency edges.
17. Documentation, API Reference & Portal Links#
Conceptual Documentation (Starlight) →
Extracted XML API Reference →
17 namespaces · 67 types · 277 members
Ecosystem Dependency Map →
Learning Center & Handbook →
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