From 10d49acf1c93b4d4759ef8041fd9cd3f038a916d Mon Sep 17 00:00:00 2001 From: Arne Dumarey Date: Fri, 28 Jun 2024 09:48:16 +0200 Subject: [PATCH] fix(consumer): disable backoffice retry for transaction --- .../Program.cs | 2 +- .../Infrastructure/ConsumerAddressModule.cs | 2 +- .../output.sql | 43 ------------------- 3 files changed, 2 insertions(+), 45 deletions(-) delete mode 100644 src/ParcelRegistry.Projections.Extract/output.sql diff --git a/src/ParcelRegistry.Consumer.Address.Console/Program.cs b/src/ParcelRegistry.Consumer.Address.Console/Program.cs index 85f79982..96f53406 100644 --- a/src/ParcelRegistry.Consumer.Address.Console/Program.cs +++ b/src/ParcelRegistry.Consumer.Address.Console/Program.cs @@ -79,7 +79,7 @@ public static async Task Main(string[] args) .AddDbContextFactory((_, options) => options .UseLoggerFactory(loggerFactory) .UseSqlServer(hostContext.Configuration.GetConnectionString("BackOffice"), sqlServerOptions => sqlServerOptions - .EnableRetryOnFailure() + //.EnableRetryOnFailure() .MigrationsHistoryTable(MigrationTables.BackOffice, Schema.BackOffice) )); diff --git a/src/ParcelRegistry.Consumer.Address/Infrastructure/ConsumerAddressModule.cs b/src/ParcelRegistry.Consumer.Address/Infrastructure/ConsumerAddressModule.cs index 958113e2..0e7927f4 100644 --- a/src/ParcelRegistry.Consumer.Address/Infrastructure/ConsumerAddressModule.cs +++ b/src/ParcelRegistry.Consumer.Address/Infrastructure/ConsumerAddressModule.cs @@ -44,7 +44,7 @@ private static void RunOnSqlServer( .UseLoggerFactory(loggerFactory) .UseSqlServer(consumerProjectionsConnectionString, sqlServerOptions => { - //sqlServerOptions.EnableRetryOnFailure(); + sqlServerOptions.EnableRetryOnFailure(); sqlServerOptions.MigrationsHistoryTable(MigrationTables.ConsumerAddress, Schema.ConsumerAddress); sqlServerOptions.UseNetTopologySuite(); sqlServerOptions.CommandTimeout(120); diff --git a/src/ParcelRegistry.Projections.Extract/output.sql b/src/ParcelRegistry.Projections.Extract/output.sql deleted file mode 100644 index d3eb4b07..00000000 --- a/src/ParcelRegistry.Projections.Extract/output.sql +++ /dev/null @@ -1,43 +0,0 @@ -BEGIN TRANSACTION; -GO - -DROP TABLE [ParcelRegistryExtract].[ParcelLinks]; -GO - -ALTER TABLE [ParcelRegistryExtract].[ParcelLinksWithCount] DROP CONSTRAINT [PK_ParcelLinksWithCount]; -GO - -EXEC sp_rename N'[ParcelRegistryExtract].[ParcelLinksWithCount]', N'ParcelLinks'; -GO - -ALTER TABLE [ParcelRegistryExtract].[ParcelLinks] ADD CONSTRAINT [PK_ParcelLinks] PRIMARY KEY NONCLUSTERED ([ParcelId], [AddressPersistentLocalId]); -GO - -EXEC sp_rename N'[ParcelRegistryExtract].[ParcelLinks].[IX_ParcelLinksWithCount_CaPaKey]', N'IX_ParcelLinks_CaPaKey', N'INDEX'; -GO - -EXEC sp_rename N'[ParcelRegistryExtract].[ParcelLinks].[IX_ParcelLinksWithCount_AddressPersistentLocalId]', N'IX_ParcelLinks_AddressPersistentLocalId', N'INDEX'; -GO - -EXEC sp_rename N'[ParcelRegistryExtract].[ParcelLinks].[IX_ParcelLinksWithCount_ParcelId]', N'IX_ParcelLinks_ParcelId', N'INDEX'; -GO - -ALTER TABLE [ParcelRegistryExtract].[ParcelV2] DROP CONSTRAINT [PK_ParcelV2]; -GO - -EXEC sp_rename N'[ParcelRegistryExtract].[ParcelV2]', N'Parcels'; -GO - -ALTER TABLE [ParcelRegistryExtract].[Parcels] ADD CONSTRAINT [PK_Parcels] PRIMARY KEY NONCLUSTERED ([ParcelId]); -GO - -EXEC sp_rename N'[ParcelRegistryExtract].[Parcels].[IX_ParcelV2_CaPaKey]', N'IX_Parcels_CaPaKey', N'INDEX'; -GO - -INSERT INTO [ParcelRegistryExtract].[__EFMigrationsHistoryExtract] ([MigrationId], [ProductVersion]) -VALUES (N'20240607143051_DeleteOldLinksRenameNew', N'8.0.3'); -GO - -COMMIT; -GO -