From 847b1bb6980d12ab3251f4e7ce93c6cf3aac5dd3 Mon Sep 17 00:00:00 2001 From: Michael Lipin Date: Tue, 12 Mar 2024 22:23:06 +0300 Subject: [PATCH 1/2] Prevent session connection closing in WorkflowTypeController. --- .../OrchardCore.Workflows/Controllers/WorkflowTypeController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/WorkflowTypeController.cs b/src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/WorkflowTypeController.cs index f557944af70..44c1425e2ed 100644 --- a/src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/WorkflowTypeController.cs +++ b/src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/WorkflowTypeController.cs @@ -121,7 +121,7 @@ public async Task Index(WorkflowTypeIndexOptions options, PagerPa .Take(pager.PageSize) .ListAsync(); - using var connection = await _session.CreateConnectionAsync(); + var connection = await _session.CreateConnectionAsync(); var dialect = _session.Store.Configuration.SqlDialect; var sqlBuilder = dialect.CreateBuilder(_session.Store.Configuration.TablePrefix); From d5c8c11fe24eee6f516166e710704bbf5e525898 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Ros?= Date: Tue, 12 Mar 2024 13:27:29 -0700 Subject: [PATCH 2/2] Update WorkflowTypeController.cs --- .../OrchardCore.Workflows/Controllers/WorkflowTypeController.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/WorkflowTypeController.cs b/src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/WorkflowTypeController.cs index 44c1425e2ed..1c6096d3ede 100644 --- a/src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/WorkflowTypeController.cs +++ b/src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/WorkflowTypeController.cs @@ -121,6 +121,7 @@ public async Task Index(WorkflowTypeIndexOptions options, PagerPa .Take(pager.PageSize) .ListAsync(); + // The existing session's connection is returned, don't dispose it var connection = await _session.CreateConnectionAsync(); var dialect = _session.Store.Configuration.SqlDialect;