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:
Stefan
2026-09-16 09:42:32 +02:00
parent 8bcec409c5
commit b26c24ef98
9 changed files with 115 additions and 24 deletions
@@ -20,6 +20,11 @@ BEGIN
DECLARE @tmp_cmd nvarchar(1000) = N'SELECT DISTINCT * FROM ' + @tblname
INSERT INTO @tmp EXECUTE [sp_executesql] @tmp_cmd;
-- Wrapping the DELETEs + MERGE below in one transaction gives all-or-nothing atomicity for
-- this entity's sync batch (same pattern in every mfr__updt__* proc). During a large full
-- reset this can hold locks on the affected tables for as long as the batch takes to run —
-- an accepted, documented risk, not an oversight. See
-- Docs/Decisions/0022-mfr-sync-transaction-blocking-accepted-risk.md before changing this.
BEGIN TRANSACTION;
IF @referencetable = 'mfr__companies'