Skip to content

Commit 919ac0c

Browse files
authored
Merge branch 'master' into db2
2 parents 0466f7d + db22eaa commit 919ac0c

File tree

523 files changed

+10004
-7092
lines changed

Some content is hidden

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

523 files changed

+10004
-7092
lines changed

.config/dotnet-tools.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
"isRoot": true,
44
"tools": {
55
"csharpasyncgenerator.tool": {
6-
"version": "0.21.1",
6+
"version": "0.22.0",
77
"commands": [
88
"async-generator"
99
]
1010
},
1111
"gitreleasemanager.tool": {
12-
"version": "0.11.0",
12+
"version": "0.17.0",
1313
"commands": [
1414
"dotnet-gitreleasemanager"
1515
]

.editorconfig

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ root=true
22

33
[*]
44
insert_final_newline = true
5+
charset = utf-8
56

67
[*.cs]
78
indent_style = tab
@@ -15,28 +16,29 @@ csharp_new_line_before_members_in_object_initializers = true
1516
csharp_new_line_before_members_in_anonymous_types = true
1617
csharp_new_line_between_query_expression_clauses = true
1718

19+
dotnet_diagnostic.NUnit1032.severity = suggestion
20+
dotnet_diagnostic.NUnit1028.severity = none
21+
dotnet_diagnostic.NUnit2045.severity = none
22+
# Consider using the constraint model, Assert.That
23+
dotnet_diagnostic.NUnit2005.severity = suggestion
24+
dotnet_diagnostic.NUnit2006.severity = suggestion
25+
dotnet_diagnostic.NUnit2015.severity = suggestion
26+
dotnet_diagnostic.NUnit2031.severity = suggestion
27+
dotnet_diagnostic.NUnit2049.severity = suggestion
28+
# The SameAs constraint always fails on value types as the actual and the expected value cannot be the same reference
29+
dotnet_diagnostic.NUnit2040.severity = suggestion
30+
1831
[*.xsd]
1932
indent_style = tab
2033

2134
[*.json]
2235
indent_style = space
2336
indent_size = 2
2437

25-
[*.xml]
38+
[{*.xml,*.csproj,*.vbproj}]
2639
indent_style = space
2740
indent_size = 2
28-
29-
[*.csproj]
30-
indent_style = space
31-
indent_size = 2
32-
33-
[*.vbproj]
34-
indent_style = space
35-
indent_size = 2
36-
37-
[*.cshtml]
38-
indent_style = space
39-
indent_size = 4
41+
ij_xml_space_inside_empty_tag = true
4042

4143
[*.g]
4244
indent_style = tab

.github/renovate.json

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
33
"extends": [
4-
"config:base"
4+
"config:recommended"
55
],
66
"configMigration": true,
77
"pruneStaleBranches": false,
@@ -15,20 +15,10 @@
1515
],
1616
"packageRules": [
1717
{
18-
"matchPackagePrefixes": [
19-
"NUnit"
18+
"matchSourceUrls": [
19+
"https://github.com/nunit/nunit"
2020
],
2121
"groupName": "NUnit"
22-
},
23-
{
24-
"matchPackageNames": [
25-
"Microsoft.AspNetCore",
26-
"Microsoft.AspNetCore.Mvc",
27-
"Microsoft.AspNetCore.Mvc.Razor.ViewCompilation",
28-
"Microsoft.AspNetCore.StaticFiles"
29-
],
30-
"groupName": "Microsoft.AspNetCore 2.0",
31-
"allowedVersions": "~2.1.0"
3222
},
3323
{
3424
"matchPackagePrefixes": [

.github/workflows/GenerateAsyncCode.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616
with:
1717
ref: ${{ github.event.pull_request.head.ref }}
1818
repository: ${{ github.event.pull_request.head.repo.full_name }}
1919
token: ${{ secrets.NHIBERNATE_BOT_TOKEN }}
2020

2121
- name: Setup .NET
22-
uses: actions/setup-dotnet@v3
22+
uses: actions/setup-dotnet@v4
2323
with:
24-
dotnet-version: 6.0.x
24+
dotnet-version: 8.0.x
2525

2626
- name: Generate Async code
2727
run: |

.github/workflows/NetCoreTests.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ jobs:
1212
CONNECTION_STRING: "Server=localhost;initial catalog=nhibernate;User Id=sa;Password=P@ssw0rd;packet size=4096;"
1313
DB_INIT: |
1414
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=P@ssw0rd" -e "MSSQL_PID=Express" -p 1433:1433 -d --name sqlexpress mcr.microsoft.com/mssql/server:2019-latest;
15+
- DB: SqlServer2008-MicrosoftDataSqlClientDriver
16+
CONNECTION_STRING: "Server=localhost;initial catalog=nhibernate;User Id=sa;Password=P@ssw0rd;packet size=4096;"
17+
DB_INIT: |
18+
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=P@ssw0rd" -e "MSSQL_PID=Express" -p 1433:1433 -d --name sqlexpress mcr.microsoft.com/mssql/server:2019-latest;
1519
- DB: PostgreSQL
1620
CONNECTION_STRING: "Host=localhost;Username=nhibernate;Password=nhibernate;Database=nhibernate;Enlist=true;"
1721
DB_INIT: |
@@ -55,11 +59,11 @@ jobs:
5559
steps:
5660
- name: Set up ${{matrix.DB}}
5761
run: ${{matrix.DB_INIT}}
58-
- uses: actions/checkout@v3
62+
- uses: actions/checkout@v4
5963
- name: Setup .NET
60-
uses: actions/setup-dotnet@v3
64+
uses: actions/setup-dotnet@v4
6165
with:
62-
dotnet-version: 6.0.x
66+
dotnet-version: 8.0.x
6367

6468
- name: Build and Test
6569
run: |

SECURITY.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
| Version | Supported |
6+
| ------- | ------------------ |
7+
| 5.5.x | :white_check_mark: |
8+
| 5.4.x | :white_check_mark: |
9+
| < 5.4 | :x: |
10+
11+
## Reporting a Vulnerability
12+
13+
**Please do NOT report security vulnerabilities through public GitHub issues.**
14+
15+
Instead, please submit vulnerabilities using this [form](https://github.com/nhibernate/nhibernate-core/security/advisories/new).
16+
If the issue is confirmed, we will try to release a patch version as soon as possible depending on complexity.

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 net6.0
176-
dotnet test ./src/NHibernate.Test.VisualBasic/NHibernate.Test.VisualBasic.vbproj -f net6.0
175+
dotnet test ./src/NHibernate.Test/NHibernate.Test.csproj -f net8.0
176+
dotnet test ./src/NHibernate.Test.VisualBasic/NHibernate.Test.VisualBasic.vbproj -f net8.0
177177
mainMenu
178178
}
179179

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>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
</PropertyGroup>
66
</Project>

Tools/packages.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</ItemGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="NUnit.Console" Version="3.10.0" />
14+
<PackageReference Include="NUnit.Console" Version="3.17.0" />
1515
</ItemGroup>
1616

1717
</Project>

appveyor.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ environment:
44
matrix:
55
- DB: SqlServer2008
66
CONNECTION_STRING: Server=(local)\SQL2017;User ID=sa;Password=Password12!;initial catalog=nhibernate;
7+
- DB: SqlServer2008-MicrosoftDataSqlClientDriver
8+
CONNECTION_STRING: Server=(local)\SQL2017;User ID=sa;Password=Password12!;initial catalog=nhibernate;
79
- DB: PostgreSQL
810
CONNECTION_STRING: Host=localhost;Port=5432;Username=postgres;Password=Password12!;Database=nhibernate;Enlist=true;
911
- DB: Firebird
@@ -61,10 +63,10 @@ before_test:
6163
Pop-Location
6264
}
6365
'MySQL' {
64-
Start-Service 'MySQL57'
66+
Start-Service 'MySQL80'
6567
# Create nhibernate database (not handled by NHibernate.TestDatabaseSetup.dll)
6668
$env:MYSQL_PWD = 'Password12!'
67-
& 'C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql' -e 'CREATE DATABASE nhibernate CHARACTER SET utf8 COLLATE utf8_general_ci;' --user=root
69+
& 'C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql' -e 'CREATE DATABASE nhibernate CHARACTER SET utf8 COLLATE utf8_general_ci;' --user=root
6870
}
6971
'Odbc' { Start-Service 'MSSQL$SQL2017' }
7072
'PostgreSQL' {
@@ -73,7 +75,9 @@ before_test:
7375
Start-Service 'postgresql-x64-10'
7476
}
7577
'SqlServer2008' { Start-Service 'MSSQL$SQL2017' }
78+
'SqlServer2008-MicrosoftDataSqlClientDriver' { Start-Service 'MSSQL$SQL2017' }
7679
'SqlServer2012' { Start-Service 'MSSQL$SQL2017' }
80+
'SqlServer2012-MicrosoftDataSqlClientDriver' { Start-Service 'MSSQL$SQL2017' }
7781
'SQLite' { }
7882
}
7983
test_script:

build-common/NHibernate.props

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,28 @@
22
<Import Condition="Exists('NHibernate.dev.props')" Project="NHibernate.dev.props"/>
33

44
<PropertyGroup>
5-
<NhVersion Condition="'$(NhVersion)' == ''" >5.5</NhVersion>
5+
<NhVersion Condition="'$(NhVersion)' == ''" >5.6</NhVersion>
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>
9+
<LangVersion Condition="'$(MSBuildProjectExtension)' != '.vbproj'">12.0</LangVersion>
1010

1111
<VersionPrefix Condition="'$(VersionPrefix)' == ''">$(NhVersion).$(VersionPatch)</VersionPrefix>
1212
<VersionSuffix Condition="'$(VersionSuffix)' != '' AND '$(BuildNumber)' != ''">$(VersionSuffix).$(BuildNumber)</VersionSuffix>
1313
<AssemblyVersion>$(NhVersion).0.0</AssemblyVersion>
1414
<FileVersion Condition="'$(VersionSuffix)' != '' AND '$(BuildNumber)' != ''">$(VersionPrefix).$(BuildNumber)</FileVersion>
1515
<FileVersion Condition="'$(FileVersion)' == ''">$(VersionPrefix).0</FileVersion>
1616

17-
<NhAppTargetFrameworks Condition ="$(NhAppTargetFrameworks) == ''">net48;net6.0</NhAppTargetFrameworks>
18-
<NhLibTargetFrameworks Condition ="$(NhLibTargetFrameworks) == ''">net461;net48;netcoreapp2.0;netstandard2.0;netstandard2.1;net6.0</NhLibTargetFrameworks>
17+
<NhAppTargetFrameworks Condition ="$(NhAppTargetFrameworks) == ''">net48;net8.0</NhAppTargetFrameworks>
18+
<NhLibTargetFrameworks Condition ="$(NhLibTargetFrameworks) == ''">net461;net48;netcoreapp2.0;netstandard2.0;netstandard2.1;net6.0;net8.0</NhLibTargetFrameworks>
1919
<NhNetFx>false</NhNetFx>
2020
<NhNetFx Condition="$(TargetFramework.StartsWith('net4'))">true</NhNetFx>
2121
<!-- Visual Basic requires to use coma (,) as a separator, other project types - semicolon (;) -->
2222
<DefineConstants Condition="$(NhNetFx) AND '$(MSBuildProjectExtension)' != '.vbproj'">NETFX;$(DefineConstants)</DefineConstants>
2323
<DefineConstants Condition="$(NhNetFx) AND '$(MSBuildProjectExtension)' == '.vbproj'">NETFX,$(DefineConstants)</DefineConstants>
24+
<NoWarn>$(NoWarn);NU1903</NoWarn>
2425
<NoWarn Condition="'$(TargetFramework)' == 'net6.0'">$(NoWarn);SYSLIB0011</NoWarn>
26+
<NoWarn Condition="'$(TargetFramework)' == 'net8.0'">$(NoWarn);SYSLIB0011;SYSLIB0050;SYSLIB0051</NoWarn>
2527

2628
<Product>NHibernate</Product>
2729
<Company>NHibernate.info</Company>

build-common/teamcity-hibernate.cfg.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,7 @@
2626
<property name="odbc.explicit_datetime_scale"></property>
2727
<property name="oracle.use_n_prefixed_types_for_unicode"></property>
2828
<property name="query.default_cast_length"></property>
29+
<property name="transaction.ignore_session_synchronization_failures"></property>
30+
<property name="transaction.system_completion_lock_timeout"></property>
2931
</session-factory>
3032
</hibernate-configuration>

default.build

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,26 @@
139139
<namespace prefix="hbm" uri="urn:nhibernate-configuration-2.2" />
140140
</namespaces>
141141
</xmlpoke>
142+
143+
<!-- Make sure the property exists - it's only set for some scenarios. -->
144+
<property name="nhibernate.transaction.ignore_session_synchronization_failures" value="" unless="${property::exists('nhibernate.transaction.ignore_session_synchronization_failures')}"/>
145+
<xmlpoke file="${app.config}"
146+
xpath="//*/hbm:property[@name='transaction.ignore_session_synchronization_failures']"
147+
value="${nhibernate.transaction.ignore_session_synchronization_failures}">
148+
<namespaces>
149+
<namespace prefix="hbm" uri="urn:nhibernate-configuration-2.2" />
150+
</namespaces>
151+
</xmlpoke>
152+
153+
<!-- Make sure the property exists - it's only set for some scenarios. -->
154+
<property name="nhibernate.transaction.system_completion_lock_timeout" value="" unless="${property::exists('nhibernate.transaction.system_completion_lock_timeout')}"/>
155+
<xmlpoke file="${app.config}"
156+
xpath="//*/hbm:property[@name='transaction.system_completion_lock_timeout']"
157+
value="${nhibernate.transaction.system_completion_lock_timeout}">
158+
<namespaces>
159+
<namespace prefix="hbm" uri="urn:nhibernate-configuration-2.2" />
160+
</namespaces>
161+
</xmlpoke>
142162
</target>
143163

144164
<target name="put-connection-settings-into-app-config">

doc/reference/modules/basic_mapping.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3919,7 +3919,8 @@
39193919
<row>
39203920
<entry><literal>CultureInfo</literal></entry>
39213921
<entry><literal>System.Globalization.CultureInfo</literal></entry>
3922-
<entry><literal>DbType.String</literal> - 5 chars for culture</entry>
3922+
<entry><literal>DbType.String</literal> - 5 chars for culture by default;
3923+
can be modified by the <literal>length</literal> mapping attribute.</entry>
39233924
<entry>Default when no <literal>type</literal> attribute specified.</entry>
39243925
</row>
39253926
<row>

doc/reference/modules/configuration.xml

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,8 +1050,8 @@ var session = sessions.OpenSession(conn);
10501050
after scope disposal. This occurs when the transaction is distributed.
10511051
This notably concerns <literal>ISessionImplementor.AfterTransactionCompletion(bool, ITransaction)</literal>.
10521052
NHibernate protects the session from being concurrently used by the code following the scope disposal
1053-
with a lock. To prevent any application freeze, this lock has a default timeout of five seconds. If the
1054-
application appears to require longer (!) running transaction completion events, this setting allows to
1053+
with a lock. To prevent any application freeze, this lock has a default timeout of one second. If the
1054+
application appears to require longer running transaction completion events, this setting allows to
10551055
raise this timeout. <literal>-1</literal> disables the timeout.
10561056
</para>
10571057
<para>
@@ -1060,6 +1060,33 @@ var session = sessions.OpenSession(conn);
10601060
</para>
10611061
</entry>
10621062
</row>
1063+
<row>
1064+
<entry>
1065+
<literal>transaction.ignore_session_synchronization_failures</literal>
1066+
</entry>
1067+
<entry>
1068+
Whether session synchronisation failures occuring during finalizations of system transaction should be
1069+
ignored or not. <literal>false</literal> by default.
1070+
<para>
1071+
When a system transaction terminates abnormaly, especially through timeouts, it may have its
1072+
completion events running on concurrent threads while the session is still performing some processing.
1073+
To prevent threading concurrency failures, NHibernate then wait for the session to end its processing,
1074+
up to <literal>transaction.system_completion_lock_timeout</literal>. If the session processing is still ongoing
1075+
afterwards, it will by default log an error, perform transaction finalization processing concurrently,
1076+
then throw a synchronization error. This setting allows to disable that later throw.
1077+
</para>
1078+
<para>
1079+
Disabling the throw can be useful if the used data provider has its own locking mechanism applied
1080+
during transaction completion, preventing the session to end its processing. It may then be safe to
1081+
ignore this synchronization failure. In case of threading concurrency failure, you may then need to
1082+
raise <literal>transaction.system_completion_lock_timeout</literal>.
1083+
</para>
1084+
<para>
1085+
<emphasis role="strong">eg.</emphasis>
1086+
<literal>true</literal> | <literal>false</literal>
1087+
</para>
1088+
</entry>
1089+
</row>
10631090
<row>
10641091
<entry>
10651092
<literal>transaction.auto_join</literal>
@@ -1515,12 +1542,6 @@ in the parameter binding.</programlisting>
15151542
<entry><literal>NHibernate.Dialect.PostgreSQLDialect</literal></entry>
15161543
<entry></entry>
15171544
</row>
1518-
<row>
1519-
<entry>PostgreSQL</entry>
1520-
<entry><literal>NHibernate.Dialect.PostgreSQLDialect</literal></entry>
1521-
<entry>
1522-
</entry>
1523-
</row>
15241545
<row>
15251546
<entry>PostgreSQL 8.1</entry>
15261547
<entry><literal>NHibernate.Dialect.PostgreSQL81Dialect</literal></entry>

doc/reference/modules/manipulating_data.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -838,9 +838,11 @@ sess.Lock(pk, LockMode.Upgrade);]]></programlisting>
838838
It is possible to change the default behavior so that flush occurs less frequently.
839839
The <literal>FlushMode</literal> class defines three different modes:
840840
only flush at commit time (and only when the NHibernate <literal>ITransaction</literal>
841-
API is used, or inside a transaction scope), flush automatically using the explained
842-
routine (will only work inside an explicit NHibernate <literal>ITransaction</literal> or
843-
inside a transaction scope), or never flush unless
841+
API is used, or inside a transaction scope with a legacy option enabled - see
842+
<xref linkend="transactions-scopes"/>), flush automatically using the explained
843+
routine (will only work inside an explicit NHibernate <literal>ITransaction</literal>, or
844+
inside a transaction scope with limitations for flushes on commit - see
845+
<xref linkend="transactions-scopes"/>), or never flush unless
844846
<literal>Flush()</literal> is called explicitly. The last mode is useful for long
845847
running units of work, where an ISession is kept open and disconnected for a long time
846848
(see <xref linkend="transactions-optimistic" />).

0 commit comments

Comments
 (0)