Added rollback transaction before an exception is thrown

This commit is contained in:
Daniel Ferrer 2024-09-27 14:31:21 +02:00
Родитель 72e4faeed3
Коммит 0d208b6d49
1 изменённых файлов: 48 добавлений и 0 удалений

Просмотреть файл

@ -204,6 +204,9 @@ BEGIN
ELSE ELSE
BEGIN BEGIN
PRINT 'Suffered an error for which Retry is inappropriate.'; PRINT 'Suffered an error for which Retry is inappropriate.';
IF XACT_STATE() = -1
ROLLBACK TRANSACTION;
THROW; THROW;
END END
END CATCH END CATCH
@ -287,6 +290,9 @@ BEGIN
ELSE ELSE
BEGIN BEGIN
PRINT 'Suffered an error for which Retry is inappropriate.'; PRINT 'Suffered an error for which Retry is inappropriate.';
IF XACT_STATE() = -1
ROLLBACK TRANSACTION;
THROW; THROW;
END END
END CATCH END CATCH
@ -348,6 +354,9 @@ BEGIN
ELSE ELSE
BEGIN BEGIN
PRINT 'Suffered an error for which Retry is inappropriate.'; PRINT 'Suffered an error for which Retry is inappropriate.';
IF XACT_STATE() = -1
ROLLBACK TRANSACTION;
THROW; THROW;
END END
END CATCH END CATCH
@ -410,6 +419,9 @@ BEGIN
ELSE ELSE
BEGIN BEGIN
PRINT 'Suffered an error for which Retry is inappropriate.'; PRINT 'Suffered an error for which Retry is inappropriate.';
IF XACT_STATE() = -1
ROLLBACK TRANSACTION;
THROW; THROW;
END END
END CATCH END CATCH
@ -471,6 +483,9 @@ BEGIN
ELSE ELSE
BEGIN BEGIN
PRINT 'Suffered an error for which Retry is inappropriate.'; PRINT 'Suffered an error for which Retry is inappropriate.';
IF XACT_STATE() = -1
ROLLBACK TRANSACTION;
THROW; THROW;
END END
END CATCH END CATCH
@ -772,6 +787,9 @@ AS
ELSE ELSE
BEGIN BEGIN
PRINT 'Suffered an error for which Retry is inappropriate.'; PRINT 'Suffered an error for which Retry is inappropriate.';
IF XACT_STATE() = -1
ROLLBACK TRANSACTION;
THROW; THROW;
END END
END CATCH END CATCH
@ -838,6 +856,9 @@ AS
ELSE ELSE
BEGIN BEGIN
PRINT 'Suffered an error for which Retry is inappropriate.'; PRINT 'Suffered an error for which Retry is inappropriate.';
IF XACT_STATE() = -1
ROLLBACK TRANSACTION;
THROW; THROW;
END END
END CATCH END CATCH
@ -916,6 +937,9 @@ AS
ELSE ELSE
BEGIN BEGIN
PRINT 'Suffered an error for which Retry is inappropriate.'; PRINT 'Suffered an error for which Retry is inappropriate.';
IF XACT_STATE() = -1
ROLLBACK TRANSACTION;
THROW; THROW;
END END
END CATCH END CATCH
@ -996,6 +1020,9 @@ AS
ELSE ELSE
BEGIN BEGIN
PRINT 'Suffered an error for which Retry is inappropriate.'; PRINT 'Suffered an error for which Retry is inappropriate.';
IF XACT_STATE() = -1
ROLLBACK TRANSACTION;
THROW; THROW;
END END
END CATCH END CATCH
@ -1080,6 +1107,9 @@ AS
ELSE ELSE
BEGIN BEGIN
PRINT 'Suffered an error for which Retry is inappropriate.'; PRINT 'Suffered an error for which Retry is inappropriate.';
IF XACT_STATE() = -1
ROLLBACK TRANSACTION;
THROW; THROW;
END END
END CATCH END CATCH
@ -1149,6 +1179,9 @@ AS
ELSE ELSE
BEGIN BEGIN
PRINT 'Suffered an error for which Retry is inappropriate.'; PRINT 'Suffered an error for which Retry is inappropriate.';
IF XACT_STATE() = -1
ROLLBACK TRANSACTION;
THROW; THROW;
END END
END CATCH END CATCH
@ -1214,6 +1247,9 @@ AS
ELSE ELSE
BEGIN BEGIN
PRINT 'Suffered an error for which Retry is inappropriate.'; PRINT 'Suffered an error for which Retry is inappropriate.';
IF XACT_STATE() = -1
ROLLBACK TRANSACTION;
THROW; THROW;
END END
END CATCH END CATCH
@ -1255,6 +1291,9 @@ DECLARE @retry INT = 10;
ELSE ELSE
BEGIN BEGIN
PRINT 'Suffered an error for which Retry is inappropriate.'; PRINT 'Suffered an error for which Retry is inappropriate.';
IF XACT_STATE() = -1
ROLLBACK TRANSACTION;
THROW; THROW;
END END
END CATCH END CATCH
@ -1296,6 +1335,9 @@ DECLARE @retry INT = 10;
ELSE ELSE
BEGIN BEGIN
PRINT 'Suffered an error for which Retry is inappropriate.'; PRINT 'Suffered an error for which Retry is inappropriate.';
IF XACT_STATE() = -1
ROLLBACK TRANSACTION;
THROW; THROW;
END END
END CATCH END CATCH
@ -1335,6 +1377,9 @@ DECLARE @retry INT = 10;
ELSE ELSE
BEGIN BEGIN
PRINT 'Suffered an error for which Retry is inappropriate.'; PRINT 'Suffered an error for which Retry is inappropriate.';
IF XACT_STATE() = -1
ROLLBACK TRANSACTION;
THROW; THROW;
END END
END CATCH END CATCH
@ -1382,6 +1427,9 @@ DECLARE @retry INT = 10;
ELSE ELSE
BEGIN BEGIN
PRINT 'Suffered an error for which Retry is inappropriate.'; PRINT 'Suffered an error for which Retry is inappropriate.';
IF XACT_STATE() = -1
ROLLBACK TRANSACTION;
THROW; THROW;
END END
END CATCH END CATCH