Skip to content

Commit ea81bc5

Browse files
authored
Merge branch 'master' into nh3565
2 parents b6b78ca + 6017fdc commit ea81bc5

File tree

196 files changed

+3993
-1898
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+3993
-1898
lines changed

.config/dotnet-tools.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"isRoot": true,
44
"tools": {
55
"csharpasyncgenerator.tool": {
6-
"version": "0.19.1",
6+
"version": "0.20.1",
77
"commands": [
88
"async-generator"
99
]
1010
}
1111
}
12-
}
12+
}

.deepsource.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version = 1
2+
3+
test_patterns = ["src/NHibernate.Test/**"]
4+
5+
[[analyzers]]
6+
name = "csharp"
7+
enabled = true

.github/dependabot.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ updates:
44
directory: "/"
55
schedule:
66
interval: daily
7+
rebase-strategy: "disabled"
78
open-pull-requests-limit: 10
89
ignore:
910
- dependency-name: Microsoft.AspNetCore

.github/workflows/NetCoreTests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- DB: Firebird
1616
CONNECTION_STRING: "DataSource=localhost;Database=nhibernate;User=SYSDBA;Password=nhibernate;charset=utf8;"
1717
- DB: MySQL
18-
CONNECTION_STRING: "Server=localhost;Uid=root;Password=nhibernate;Database=nhibernate;Old Guids=True;"
18+
CONNECTION_STRING: "Server=localhost;Uid=root;Password=nhibernate;Database=nhibernate;Old Guids=True;SslMode=none;"
1919
- DB: Oracle
2020
CONNECTION_STRING: "User ID=nhibernate;Password=nhibernate;Metadata Pooling=false;Self Tuning=false;Data Source=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XEPDB1)))"
2121
- DB: SQLite
@@ -54,9 +54,9 @@ jobs:
5454
5555
- uses: actions/checkout@v2
5656
- name: Setup .NET
57-
uses: actions/setup-dotnet@v1.8.0
57+
uses: actions/setup-dotnet@v1
5858
with:
59-
dotnet-version: 2.1.x
59+
dotnet-version: 6.0.x
6060

6161
- name: Build and Test
6262
run: |

NHibernate.nunit

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<NUnitProject>
22
<Settings activeconfig="Debug" processModel="Multiple" />
33
<Config name="Debug" binpathtype="Auto" runtimeFramework="net-4.0">
4-
<assembly path="src\NHibernate.TestDatabaseSetup\bin\Debug\net461\NHibernate.TestDatabaseSetup.dll" />
5-
<assembly path="src\NHibernate.Test\bin\Debug\net461\NHibernate.Test.dll" />
6-
<assembly path="src\NHibernate.Test.VisualBasic\bin\Debug\net461\NHibernate.Test.VisualBasic.dll" />
4+
<assembly path="src\NHibernate.TestDatabaseSetup\bin\Debug\net48\NHibernate.TestDatabaseSetup.dll" />
5+
<assembly path="src\NHibernate.Test\bin\Debug\net48\NHibernate.Test.dll" />
6+
<assembly path="src\NHibernate.Test.VisualBasic\bin\Debug\net48\NHibernate.Test.VisualBasic.dll" />
77
</Config>
88
<Config name="Release" binpathtype="Auto" runtimeFramework="net-4.0">
9-
<assembly path="src\NHibernate.TestDatabaseSetup\bin\Release\net461\NHibernate.TestDatabaseSetup.dll" />
10-
<assembly path="src\NHibernate.Test\bin\Release\net461\NHibernate.Test.dll" />
11-
<assembly path="src\NHibernate.Test.VisualBasic\bin\Release\net461\NHibernate.Test.VisualBasic.dll" />
9+
<assembly path="src\NHibernate.TestDatabaseSetup\bin\Release\net48\NHibernate.TestDatabaseSetup.dll" />
10+
<assembly path="src\NHibernate.Test\bin\Release\net48\NHibernate.Test.dll" />
11+
<assembly path="src\NHibernate.Test.VisualBasic\bin\Release\net48\NHibernate.Test.VisualBasic.dll" />
1212
</Config>
1313
</NUnitProject>

ShowBuildMenu.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ testSetupMenu() {
172172
}
173173

174174
testRun(){
175-
dotnet test ./src/NHibernate.Test/NHibernate.Test.csproj -f netcoreapp2.0
176-
dotnet test ./src/NHibernate.Test.VisualBasic/NHibernate.Test.VisualBasic.vbproj -f netcoreapp2.0
175+
dotnet test ./src/NHibernate.Test/NHibernate.Test.csproj -f net6.0
176+
dotnet test ./src/NHibernate.Test.VisualBasic/NHibernate.Test.VisualBasic.vbproj -f net6.0
177177
mainMenu
178178
}
179179

Tools/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ csharpasyncgenerator.commandline/
44
gitreleasemanager/
55
obj/
66
microsoft.*
7+
netstandard.*

Tools/BuildTool/BuildTool.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<TargetFramework>netcoreapp2.0</TargetFramework>
4+
<TargetFramework>net6.0</TargetFramework>
55
</PropertyGroup>
66
</Project>

appveyor.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
version: '{build}'
2-
image: Visual Studio 2017
2+
image: Visual Studio 2022
33
environment:
44
matrix:
55
- DB: SqlServer2008
@@ -8,7 +8,7 @@ environment:
88
CONNECTION_STRING: Host=localhost;Port=5432;Username=postgres;Password=Password12!;Database=nhibernate;Enlist=true;
99
- DB: Firebird
1010
- DB: MySQL
11-
CONNECTION_STRING: Server=127.0.0.1;Uid=root;Pwd=Password12!;Database=nhibernate;Old Guids=True;SslMode=none;
11+
CONNECTION_STRING: Server=127.0.0.1;Uid=root;Pwd=Password12!;Database=nhibernate;Old Guids=True;SslMode=none;CharSet=utf8;
1212
- DB: SQLite
1313
init:
1414
# Required for having windows endlines in sources zip
@@ -42,7 +42,7 @@ before_test:
4242
Start-Service 'MySQL57'
4343
# Create nhibernate database (not handled by NHibernate.TestDatabaseSetup.dll)
4444
$env:MYSQL_PWD = 'Password12!'
45-
& 'C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql' -e 'CREATE DATABASE nhibernate;' --user=root
45+
& 'C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql' -e 'CREATE DATABASE nhibernate CHARACTER SET utf8 COLLATE utf8_general_ci;' --user=root
4646
}
4747
'Odbc' { Start-Service 'MSSQL$SQL2017' }
4848
'PostgreSQL' {

build-common/NHibernate.props

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,34 @@
66
<VersionPatch Condition="'$(VersionPatch)' == ''">0</VersionPatch>
77
<!-- Clear VersionSuffix for making release and set it to dev for making development builds -->
88
<VersionSuffix Condition="'$(VersionSuffix)' == ''">dev</VersionSuffix>
9+
<LangVersion Condition="'$(MSBuildProjectExtension)' != '.vbproj'">9.0</LangVersion>
910

1011
<VersionPrefix Condition="'$(VersionPrefix)' == ''">$(NhVersion).$(VersionPatch)</VersionPrefix>
1112
<VersionSuffix Condition="'$(VersionSuffix)' != '' AND '$(BuildNumber)' != ''">$(VersionSuffix).$(BuildNumber)</VersionSuffix>
1213
<AssemblyVersion>$(NhVersion).0.0</AssemblyVersion>
1314
<FileVersion Condition="'$(VersionSuffix)' != '' AND '$(BuildNumber)' != ''">$(VersionPrefix).$(BuildNumber)</FileVersion>
1415
<FileVersion Condition="'$(FileVersion)' == ''">$(VersionPrefix).0</FileVersion>
1516

16-
<NhAppTargetFrameworks Condition ="$(NhAppTargetFrameworks) == ''">net461;netcoreapp2.0</NhAppTargetFrameworks>
17+
<NhAppTargetFrameworks Condition ="$(NhAppTargetFrameworks) == ''">net48;net6.0</NhAppTargetFrameworks>
1718
<NhLibTargetFrameworks Condition ="$(NhLibTargetFrameworks) == ''">net461;netcoreapp2.0;netstandard2.0</NhLibTargetFrameworks>
1819
<NhNetFx>false</NhNetFx>
1920
<NhNetFx Condition="$(TargetFramework.StartsWith('net4'))">true</NhNetFx>
20-
<DefineConstants Condition="$(NhNetFx) AND $(NhVbNet) == ''" >NETFX;$(DefineConstants)</DefineConstants>
21+
<!-- Visual Basic requires to use coma (,) as a separator, other project types - semicolon (;) -->
22+
<DefineConstants Condition="$(NhNetFx) AND '$(MSBuildProjectExtension)' != '.vbproj'">NETFX;$(DefineConstants)</DefineConstants>
23+
<DefineConstants Condition="$(NhNetFx) AND '$(MSBuildProjectExtension)' == '.vbproj'">NETFX,$(DefineConstants)</DefineConstants>
2124

2225
<Product>NHibernate</Product>
2326
<Company>NHibernate.info</Company>
2427
<Copyright>Licensed under LGPL.</Copyright>
2528
<Authors>NHibernate community, Hibernate community</Authors>
2629
<NeutralLanguage>en-US</NeutralLanguage>
2730

31+
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
32+
<TreatSpecificWarningsAsErrors />
33+
34+
<DisableImplicitPackageTargetFallback>True</DisableImplicitPackageTargetFallback>
35+
</PropertyGroup>
36+
<PropertyGroup Condition="'$(IsPackable)' == 'True'">
2837
<PackageProjectUrl>https://nhibernate.info</PackageProjectUrl>
2938
<PackageIconUrl>https://raw.githubusercontent.com/nhibernate/nhibernate-core/master/logo/NHibernate-NuGet.png</PackageIconUrl>
3039
<PackageIcon>NHibernate-NuGet.png</PackageIcon>
@@ -35,11 +44,6 @@
3544
<PublishRepositoryUrl>true</PublishRepositoryUrl>
3645
<IncludeSymbols>true</IncludeSymbols>
3746
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
38-
39-
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
40-
<TreatSpecificWarningsAsErrors />
41-
42-
<DisableImplicitPackageTargetFallback>True</DisableImplicitPackageTargetFallback>
4347
</PropertyGroup>
4448
<ItemGroup>
4549
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="all" />

default.build

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
>
77

88
<property name="root.dir" value="." />
9-
<property name="target.dir" value="net461" />
9+
<property name="bin.target.dir" value="net461" />
10+
<property name="test.target.dir" value="net48" />
1011

1112
<include buildfile="${root.dir}/build-common/common.xml" />
1213

@@ -141,7 +142,7 @@
141142
</target>
142143

143144
<target name="put-connection-settings-into-app-config">
144-
<property name="app.config" value="src/${test.file}/bin/${build.config}/${target.dir}/${test.file}.dll.config" />
145+
<property name="app.config" value="src/${test.file}/bin/${build.config}/${test.target.dir}/${test.file}.dll.config" />
145146
<call target="put-connection-settings-into-defined-app-config" />
146147
</target>
147148

@@ -153,15 +154,15 @@
153154

154155
<target name="run-tests" depends="find-nunit" description="Run NUnit tests">
155156
<exec program="${nunit-console}" failonerror="${not property::exists(test.file + '.IgnoreFail')}">
156-
<arg value="${root.dir}/src/${test.file}/bin/${build.config}/${target.dir}/${test.file}.dll" />
157+
<arg value="${root.dir}/src/${test.file}/bin/${build.config}/${test.target.dir}/${test.file}.dll" />
157158
<arg value="--result=${testresults.dir}/${test.file}.dll-results.xml;format=nunit2" />
158159
<arg value="--teamcity" if="${property::exists('config.teamcity')}" />
159160
<arg value="--x86" unless="${property::exists('nunit-x64')}" />
160161
</exec>
161162
</target>
162163

163164
<target name="remove-connection-settings-from-app-config">
164-
<property name="app.config" value="${root.dir}/src/${test.file}/bin/${build.config}/${target.dir}/${test.file}.dll.config" />
165+
<property name="app.config" value="${root.dir}/src/${test.file}/bin/${build.config}/${test.target.dir}/${test.file}.dll.config" />
165166

166167
<xmlpoke
167168
file="${app.config}"
@@ -243,7 +244,7 @@
243244
</fileset>
244245
</copy>
245246
<copy todir="${bin-pack.required}">
246-
<fileset basedir="${root.dir}/src/NHibernate/bin/${build.config}/${target.dir}/">
247+
<fileset basedir="${root.dir}/src/NHibernate/bin/${build.config}/${bin.target.dir}/">
247248
<include name="Antlr3.Runtime.???" />
248249
<include name="Iesi.Collections.???" />
249250
<include name="NHibernate.???" />
@@ -260,20 +261,20 @@
260261
</fileset>
261262
</copy>
262263
<copy todir="${bin-pack.tests}">
263-
<fileset basedir="${root.dir}/src/NHibernate.Test/bin/${build.config}/${target.dir}">
264+
<fileset basedir="${root.dir}/src/NHibernate.Test/bin/${build.config}/${test.target.dir}">
264265
<include name="log4net*" />
265266
<include name="NHibernate.DomainModel.*" />
266267
<include name="NHibernate.Test.*" />
267268
<include name="nunit*" />
268269
</fileset>
269270
</copy>
270271
<copy todir="${bin-pack.tests}">
271-
<fileset basedir="${root.dir}/src/NHibernate.Test.VisualBasic/bin/${build.config}/${target.dir}">
272+
<fileset basedir="${root.dir}/src/NHibernate.Test.VisualBasic/bin/${build.config}/${test.target.dir}">
272273
<include name="NHibernate.Test.VisualBasic.*" />
273274
</fileset>
274275
</copy>
275276
<copy todir="${bin-pack.tests}">
276-
<fileset basedir="${root.dir}/src/NHibernate.TestDatabaseSetup/bin/${build.config}/${target.dir}">
277+
<fileset basedir="${root.dir}/src/NHibernate.TestDatabaseSetup/bin/${build.config}/${test.target.dir}">
277278
<include name="NHibernate.TestDatabaseSetup.*" />
278279
</fileset>
279280
</copy>

doc/reference/modules/configuration.xml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,26 @@ var session = sessions.OpenSession(conn);
610610
</para>
611611
</entry>
612612
</row>
613+
<row>
614+
<entry>
615+
<literal>cache.read_write_lock_factory</literal>
616+
</entry>
617+
<entry>
618+
Specify the cache lock factory to use for read-write cache regions.
619+
Defaults to the built-in <literal>async</literal> cache lock factory.
620+
<para>
621+
<emphasis role="strong">eg.</emphasis>
622+
<literal>async</literal>, or <literal>sync</literal>, or <literal>classname.of.CacheLockFactory, assembly</literal> with custom implementation of <literal>ICacheReadWriteLockFactory</literal>
623+
</para>
624+
<para>
625+
<literal>async</literal> uses a single writer multiple readers locking mechanism supporting asynchronous operations.
626+
</para>
627+
<para>
628+
<literal>sync</literal> uses a single access locking mechanism which will throw on asynchronous
629+
operations but may have better performances than the <literal>async</literal> provider for applications using the .Net Framework (4.8 and below).
630+
</para>
631+
</entry>
632+
</row>
613633
<row>
614634
<entry>
615635
<literal>cache.region_prefix</literal>
@@ -702,6 +722,24 @@ var session = sessions.OpenSession(conn);
702722
</para>
703723
</entry>
704724
</row>
725+
<row>
726+
<entry>
727+
<literal>query.throw_never_cached</literal>
728+
</entry>
729+
<entry>
730+
Should queries set as cacheable raise an error if they reference an entity using the cache
731+
<xref linkend="performance-cache-never" /> (the default is enabled).
732+
<para>
733+
<emphasis role="strong">eg.</emphasis>
734+
<literal>true</literal> | <literal>false</literal>
735+
</para>
736+
<para>
737+
Disabling this setting causes NHibernate to ignore the caching of such queries without
738+
raising an error. Furthermore NHibernate will log a warning on cacheable queries
739+
referencing an entity using the <literal>never</literal> cache strategy.
740+
</para>
741+
</entry>
742+
</row>
705743
<row>
706744
<entry>
707745
<literal>query.factory_class</literal>
@@ -1195,6 +1233,58 @@ var session = sessions.OpenSession(conn);
11951233
</para>
11961234
</entry>
11971235
</row>
1236+
<row>
1237+
<entry>
1238+
<literal>oracle.use_binary_floating_point_types</literal>
1239+
</entry>
1240+
<entry>
1241+
<para>
1242+
Set whether NHibernate should map .Net <literal>double</literal> and <literal>float</literal>
1243+
to Oracle <literal>BINARY_DOUBLE</literal> and <literal>BINARY_FLOAT</literal> types or use
1244+
Oracle <literal>DOUBLE</literal> and <literal>FLOAT</literal> types.
1245+
</para>
1246+
<para>
1247+
Oracle 10g introduced <literal>BINARY_DOUBLE</literal> and <literal>BINARY_FLOAT</literal>
1248+
types which are compatible with .NET <literal>double</literal> and <literal>float</literal>
1249+
types, while Oracle <literal>DOUBLE</literal> and <literal>FLOAT</literal> are not. Oracle
1250+
<literal>DOUBLE</literal> and <literal>FLOAT</literal> types do not conform to the IEEE
1251+
standard as they are internally implemented as <literal>NUMBER</literal> type, which
1252+
makes them an exact numeric type.
1253+
</para>
1254+
<para>
1255+
<emphasis role="strong">eg.</emphasis>
1256+
<literal>true</literal> for using Oracle <literal>BINARY_DOUBLE</literal> and
1257+
<literal>BINARY_FLOAT</literal> types | <literal>false</literal> for using Oracle
1258+
<literal>DOUBLE</literal> and <literal>FLOAT</literal> types.
1259+
</para>
1260+
<para>
1261+
<literal>false</literal> by default. See
1262+
<ulink url="https://docs.oracle.com/database/121/TTSQL/types.htm#TTSQL126">ANSI SQL data types</ulink>.
1263+
</para>
1264+
</entry>
1265+
</row>
1266+
<row>
1267+
<entry>
1268+
<literal>oracle.suppress_decimal_invalid_cast_exception</literal>
1269+
</entry>
1270+
<entry>
1271+
<para>
1272+
This setting specifies whether to suppress or not the <literal>InvalidCastException</literal>
1273+
and return a rounded-off 28 precision value if the Oracle <literal>NUMBER</literal> value
1274+
has more than a 28 precision.
1275+
</para>
1276+
<para>
1277+
<emphasis role="strong">eg.</emphasis>
1278+
<literal>true</literal> for suppressing the exception | <literal>false</literal> for letting
1279+
the exception be raised.
1280+
</para>
1281+
<para>
1282+
<literal>false</literal> by default. See
1283+
<ulink url="https://docs.oracle.com/en/database/oracle/oracle-data-access-components/19.3/odpnt/DataReaderSuppressGetDecimalInvalidCastException.html">SuppressGetDecimalInvalidCastException</ulink>.
1284+
This setting works only with ODP.NET 19.10 or newer.
1285+
</para>
1286+
</entry>
1287+
</row>
11981288
<row>
11991289
<entry>
12001290
<literal>odbc.explicit_datetime_scale</literal>

0 commit comments

Comments
 (0)