Skip to content

Commit ce6e8ef

Browse files
Merge branch '5.2.x'
2 parents aff89d4 + f490609 commit ce6e8ef

File tree

8 files changed

+106
-16
lines changed

8 files changed

+106
-16
lines changed

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 5.2.1.{build}
1+
version: 5.2.2.{build}
22
image: Visual Studio 2017
33
environment:
44
matrix:

build-common/NHibernate.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<PropertyGroup>
66
<VersionMajor Condition="'$(VersionMajor)' == ''">5</VersionMajor>
77
<VersionMinor Condition="'$(VersionMinor)' == ''">2</VersionMinor>
8-
<VersionPatch Condition="'$(VersionPatch)' == ''">1</VersionPatch>
8+
<VersionPatch Condition="'$(VersionPatch)' == ''">2</VersionPatch>
99
<VersionSuffix Condition="'$(VersionSuffix)' == ''"></VersionSuffix>
1010

1111
<VersionPrefix>$(VersionMajor).$(VersionMinor).$(VersionPatch)</VersionPrefix>

build-common/common.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
<!-- This is used only for build folder -->
1515
<!-- TODO: Either remove or refactor to use NHibernate.props -->
16-
<property name="project.version" value="5.2.1" overwrite="false" />
17-
<property name="project.version.numeric" value="5.2.1" overwrite="false" />
16+
<property name="project.version" value="5.2.2" overwrite="false" />
17+
<property name="project.version.numeric" value="5.2.2" overwrite="false" />
1818

1919
<!-- properties used to connect to database for testing -->
2020
<include buildfile="nhibernate-properties.xml" />

releasenotes.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
Build 5.2.2
2+
=============================
3+
4+
Release notes - NHibernate - Version 5.2.2
5+
6+
3 issues were resolved in this release.
7+
8+
** Bug
9+
10+
* #1953 Query space invalidation doesn't work for bulk actions
11+
* #1269 NH-3069 - Cannot use Session.Lock with Version column on abstract base class
12+
13+
** Task
14+
15+
* #1957 Release 5.2.2
116

217
Build 5.2.1
318
=============================
@@ -269,6 +284,15 @@ Release notes - NHibernate - Version 5.2.0
269284
As part of releasing 5.2.0, a misnamed setting in 5.0.0 release notes has been fixed:
270285
transaction.use_connection_on_system_events correct name is transaction.use_connection_on_system_prepare
271286

287+
Build 5.1.4
288+
=============================
289+
290+
Release notes - NHibernate - Version 5.1.4
291+
292+
** Bug
293+
294+
* #1959 Backport Query space invalidation doesn't work for bulk actions
295+
272296
Build 5.1.3
273297
=============================
274298

src/NHibernate.Test/Async/SecondLevelCacheTest/InvalidationTests.cs

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
using NHibernate.Cache;
1616
using NHibernate.Cfg;
1717
using NHibernate.Impl;
18+
using NHibernate.Linq;
1819
using NHibernate.Test.SecondLevelCacheTests;
1920
using NSubstitute;
2021
using NUnit.Framework;
@@ -59,6 +60,7 @@ public async Task InvalidatesEntitiesAsync()
5960

6061
using (var session = OpenSession())
6162
{
63+
//Add Item
6264
using (var tx = session.BeginTransaction())
6365
{
6466
foreach (var i in Enumerable.Range(1, 10))
@@ -70,6 +72,7 @@ public async Task InvalidatesEntitiesAsync()
7072
await (tx.CommitAsync());
7173
}
7274

75+
//Update Item
7376
using (var tx = session.BeginTransaction())
7477
{
7578
foreach (var i in Enumerable.Range(1, 10))
@@ -81,6 +84,7 @@ public async Task InvalidatesEntitiesAsync()
8184
await (tx.CommitAsync());
8285
}
8386

87+
//Delete Item
8488
using (var tx = session.BeginTransaction())
8589
{
8690
foreach (var i in Enumerable.Range(1, 10))
@@ -91,13 +95,44 @@ public async Task InvalidatesEntitiesAsync()
9195

9296
await (tx.CommitAsync());
9397
}
98+
99+
//Update Item using HQL
100+
using (var tx = session.BeginTransaction())
101+
{
102+
await (session.CreateQuery("UPDATE Item SET Name='Test'").ExecuteUpdateAsync());
103+
104+
await (tx.CommitAsync());
105+
}
106+
107+
108+
//Update Item using LINQ
109+
using (var tx = session.BeginTransaction())
110+
{
111+
await (session.Query<Item>()
112+
.UpdateBuilder()
113+
.Set(x => x.Name, "Test")
114+
.UpdateAsync(CancellationToken.None));
115+
116+
await (tx.CommitAsync());
117+
}
118+
119+
//Update Item using SQL
120+
using (var tx = session.BeginTransaction())
121+
{
122+
await (session.CreateSQLQuery("UPDATE Item SET Name='Test'")
123+
.AddSynchronizedQuerySpace("Item")
124+
.ExecuteUpdateAsync());
125+
126+
await (tx.CommitAsync());
127+
}
94128
}
95129

96-
//Should receive one preinvalidation and one invalidation per commit
130+
//Should receive one preinvalidation per non-DML commit
97131
Assert.That(preInvalidations, Has.Count.EqualTo(3));
98132
Assert.That(preInvalidations, Has.All.Count.EqualTo(1).And.Contains("Item"));
99133

100-
Assert.That(invalidations, Has.Count.EqualTo(3));
134+
///...and one invalidation per commit
135+
Assert.That(invalidations, Has.Count.EqualTo(6));
101136
Assert.That(invalidations, Has.All.Count.EqualTo(1).And.Contains("Item"));
102137
}
103138

src/NHibernate.Test/SecondLevelCacheTest/InvalidationTests.cs

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using NHibernate.Cache;
66
using NHibernate.Cfg;
77
using NHibernate.Impl;
8+
using NHibernate.Linq;
89
using NHibernate.Test.SecondLevelCacheTests;
910
using NSubstitute;
1011
using NUnit.Framework;
@@ -47,6 +48,7 @@ public void InvalidatesEntities()
4748

4849
using (var session = OpenSession())
4950
{
51+
//Add Item
5052
using (var tx = session.BeginTransaction())
5153
{
5254
foreach (var i in Enumerable.Range(1, 10))
@@ -58,6 +60,7 @@ public void InvalidatesEntities()
5860
tx.Commit();
5961
}
6062

63+
//Update Item
6164
using (var tx = session.BeginTransaction())
6265
{
6366
foreach (var i in Enumerable.Range(1, 10))
@@ -69,6 +72,7 @@ public void InvalidatesEntities()
6972
tx.Commit();
7073
}
7174

75+
//Delete Item
7276
using (var tx = session.BeginTransaction())
7377
{
7478
foreach (var i in Enumerable.Range(1, 10))
@@ -79,13 +83,44 @@ public void InvalidatesEntities()
7983

8084
tx.Commit();
8185
}
86+
87+
//Update Item using HQL
88+
using (var tx = session.BeginTransaction())
89+
{
90+
session.CreateQuery("UPDATE Item SET Name='Test'").ExecuteUpdate();
91+
92+
tx.Commit();
93+
}
94+
95+
96+
//Update Item using LINQ
97+
using (var tx = session.BeginTransaction())
98+
{
99+
session.Query<Item>()
100+
.UpdateBuilder()
101+
.Set(x => x.Name, "Test")
102+
.Update();
103+
104+
tx.Commit();
105+
}
106+
107+
//Update Item using SQL
108+
using (var tx = session.BeginTransaction())
109+
{
110+
session.CreateSQLQuery("UPDATE Item SET Name='Test'")
111+
.AddSynchronizedQuerySpace("Item")
112+
.ExecuteUpdate();
113+
114+
tx.Commit();
115+
}
82116
}
83117

84-
//Should receive one preinvalidation and one invalidation per commit
118+
//Should receive one preinvalidation per non-DML commit
85119
Assert.That(preInvalidations, Has.Count.EqualTo(3));
86120
Assert.That(preInvalidations, Has.All.Count.EqualTo(1).And.Contains("Item"));
87121

88-
Assert.That(invalidations, Has.Count.EqualTo(3));
122+
///...and one invalidation per commit
123+
Assert.That(invalidations, Has.Count.EqualTo(6));
89124
Assert.That(invalidations, Has.All.Count.EqualTo(1).And.Contains("Item"));
90125
}
91126

src/NHibernate/Async/Engine/ActionQueue.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,6 @@ private async Task InnerExecuteAsync(IExecutable executable, CancellationToken c
8282
}
8383
finally
8484
{
85-
if (executable.PropertySpaces != null)
86-
{
87-
executedSpaces.UnionWith(executable.PropertySpaces);
88-
}
8985
RegisterCleanupActions(executable);
9086
}
9187
}

src/NHibernate/Engine/ActionQueue.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,6 @@ private void InnerExecute(IExecutable executable)
199199
}
200200
finally
201201
{
202-
if (executable.PropertySpaces != null)
203-
{
204-
executedSpaces.UnionWith(executable.PropertySpaces);
205-
}
206202
RegisterCleanupActions(executable);
207203
}
208204
}
@@ -221,6 +217,10 @@ private void RegisterCleanupActions(IExecutable executable)
221217
RegisterProcess(executable.AfterTransactionCompletionProcess);
222218
#pragma warning restore 618,619
223219
}
220+
if (executable.PropertySpaces != null)
221+
{
222+
executedSpaces.UnionWith(executable.PropertySpaces);
223+
}
224224
}
225225

226226
/// <summary>

0 commit comments

Comments
 (0)