Resolve all high-severity architecture review findings
This commit is contained in:
@@ -17,8 +17,9 @@ namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts;
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// All other <see cref="DbConnection"/> members forward to the inner connection
|
||||
/// unchanged so the script keeps full ADO.NET semantics (transactions, state
|
||||
/// Transactions and command connection readback retain this wrapper so they cannot
|
||||
/// expose an unaudited provider connection. Other members forward to the inner connection
|
||||
/// so the script keeps full ADO.NET semantics (transactions, state
|
||||
/// transitions, server-version queries, etc.). Disposing the wrapper disposes
|
||||
/// the inner connection — the caller is still responsible for disposal per
|
||||
/// the <see cref="IDatabaseGateway"/> contract.
|
||||
@@ -147,7 +148,13 @@ internal sealed class AuditingDbConnection : DbConnection
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override DbTransaction BeginDbTransaction(IsolationLevel isolationLevel)
|
||||
=> _inner.BeginTransaction(isolationLevel);
|
||||
=> new AuditingDbTransaction(_inner.BeginTransaction(isolationLevel), this);
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override async ValueTask<DbTransaction> BeginDbTransactionAsync(
|
||||
IsolationLevel isolationLevel, CancellationToken cancellationToken)
|
||||
=> new AuditingDbTransaction(
|
||||
await _inner.BeginTransactionAsync(isolationLevel, cancellationToken).ConfigureAwait(false), this);
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override DbCommand CreateDbCommand()
|
||||
@@ -168,7 +175,7 @@ internal sealed class AuditingDbConnection : DbConnection
|
||||
// threaded alongside _executionId. Null for non-routed runs.
|
||||
_parentExecutionId,
|
||||
// Flow Debugger: the DbWrite rows ride the inline collector.
|
||||
_onAudit);
|
||||
_onAudit) { Connection = this };
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
Reference in New Issue
Block a user