From 418be0b23872e6b3ed2b8c229a0721a7ee49e54f Mon Sep 17 00:00:00 2001 From: Michael Kent Date: Tue, 17 Sep 2024 11:52:40 -0500 Subject: [PATCH 1/2] Fix: Regression from NHibernate 1.2 in flushing --- src/NHibernate/Impl/SessionImpl.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NHibernate/Impl/SessionImpl.cs b/src/NHibernate/Impl/SessionImpl.cs index 9a7120ae8b7..df759ac635d 100644 --- a/src/NHibernate/Impl/SessionImpl.cs +++ b/src/NHibernate/Impl/SessionImpl.cs @@ -1055,7 +1055,7 @@ public override bool AutoFlushIfRequired(ISet querySpaces) { using (BeginProcess()) { - if (!ConnectionManager.IsInActiveTransaction) + if (IsClosed) { // do not auto-flush while outside a transaction return false; From 76dd1bc8c4478ae1f8efa4d7d2fbc44c26fd5afe Mon Sep 17 00:00:00 2001 From: Michael Kent Date: Tue, 17 Sep 2024 12:31:00 -0500 Subject: [PATCH 2/2] Fix: Regression from NHibernate 1.2 in flushing, copy to async methods --- src/NHibernate/Async/Impl/SessionImpl.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NHibernate/Async/Impl/SessionImpl.cs b/src/NHibernate/Async/Impl/SessionImpl.cs index b219757f21f..e5c773e3d63 100644 --- a/src/NHibernate/Async/Impl/SessionImpl.cs +++ b/src/NHibernate/Async/Impl/SessionImpl.cs @@ -686,7 +686,7 @@ public override async Task AutoFlushIfRequiredAsync(ISet querySpac cancellationToken.ThrowIfCancellationRequested(); using (BeginProcess()) { - if (!ConnectionManager.IsInActiveTransaction) + if (IsClosed) { // do not auto-flush while outside a transaction return false;