feat: Enhance user group management and transaction handling in stored procedures
- Improved user group deletion logic to accurately report success or failure. - Updated user group renaming checks to prevent unintended inserts or updates. - Added documentation on transaction blocking risks during full resets in stored procedures. - Removed unnecessary login scripts from database project.
This commit is contained in:
@@ -16,7 +16,10 @@ public class FdsMfrClient : IDisposable
|
||||
private readonly MFRClient _mfrClient;
|
||||
private readonly ILogger<FdsMfrClient> _logger;
|
||||
|
||||
// Full-reset merges of large entity tables exceed SqlCommand's 30 s default.
|
||||
// Full-reset merges of large entity tables exceed SqlCommand's 30 s default. Raising this
|
||||
// also raises how long a full-reset's mfr__updt__* transaction can hold locks and block
|
||||
// readers of the live mfr__* tables — an accepted, documented risk, see
|
||||
// Docs/Decisions/0022-mfr-sync-transaction-blocking-accepted-risk.md.
|
||||
private const int MergeCommandTimeoutSeconds = 600;
|
||||
|
||||
private static MFRClientCredentials DefaultCredentials() =>
|
||||
@@ -259,7 +262,13 @@ public class FdsMfrClient : IDisposable
|
||||
try
|
||||
{
|
||||
tbl.AcceptChanges();
|
||||
var dtwa = new DatatableWriterAsync(tbl, FdsShared.FDSConnectionString());
|
||||
var dtwa = new DatatableWriterAsync(tbl, FdsShared.FDSConnectionString())
|
||||
{
|
||||
// A large full-reset batch can exceed SqlBulkCopy's 30s default just as
|
||||
// easily as the merge proc it feeds into — match CommandAfter's timeout
|
||||
// so staging itself doesn't fail before the merge/fds__setStatus ever runs.
|
||||
BulkCopyTimeoutSeconds = MergeCommandTimeoutSeconds
|
||||
};
|
||||
// One fixed debug copy per entity table (last failed batch) instead of a new t_<setid>_ table per attempt.
|
||||
string fallbackTable = $"t_err_{tbl.TableName}";
|
||||
dtwa.CommandAfterError = new SqlCommand(
|
||||
|
||||
Reference in New Issue
Block a user