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:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user