Skip to content

Commit 13edfda

Browse files
authored
Merge branch 'master' into GetQueryCacheConcurrency
2 parents 463b249 + 3747daf commit 13edfda

File tree

315 files changed

+6001
-1202
lines changed

Some content is hidden

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

315 files changed

+6001
-1202
lines changed

Tools/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
<package id="NUnit.Extension.NUnitV2ResultWriter" version="3.6.0" targetFramework="net461" />
88
<package id="NUnit.Extension.TeamCityEventListener" version="1.0.2" targetFramework="net461" />
99
<package id="NUnit.Extension.VSProjectLoader" version="3.6.0" targetFramework="net461" />
10-
<package id="CSharpAsyncGenerator.CommandLine" version="0.7.0" targetFramework="net461" />
10+
<package id="CSharpAsyncGenerator.CommandLine" version="0.8.1" targetFramework="net461" />
1111
<package id="vswhere" version="2.1.4" targetFramework="net461" />
1212
</packages>

build-common/NHibernate.props

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,8 @@
2121
<PackageLicenseUrl>https://raw.githubusercontent.com/nhibernate/nhibernate-core/master/LICENSE.txt</PackageLicenseUrl>
2222
<RepositoryUrl>https://github.com/nhibernate/nhibernate-core.git</RepositoryUrl>
2323
<RepositoryType>git</RepositoryType>
24+
25+
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
26+
<TreatSpecificWarningsAsErrors />
2427
</PropertyGroup>
2528
</Project>
Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,50 @@
11

2-
Installation steps for Oracle (Express Edition) for NH TeamCity:
3-
4-
1. Download Oracle Database 10g Express Edition (OracleXE.exe): http://www.oracle.com/technetwork/database/express-edition/downloads/102xewinsoft-090667.html;
2+
Installation steps for Oracle for NH TeamCity:
3+
1. Download Oracle Database 12c from https://oracle.com/. Please make sure you comply with it's license.
4+
12.2 will fail some tests (mainly NH-1171) due to a bug with comments in queries, see
5+
https://stackoverflow.com/q/7493028/1178314. So take care of installing 12.1 instead.
56
(Note: you'll need to sign-up for a (free) Oracle account to download)
67

7-
2. Run the installer ... choose any HTTP port for the listener if asked (it may automatically choose the default 8080 if available);
8-
3. Enter 'password' as the password for the SYS and SYSTEM accounts;
9-
4. The setup should install Oracle (XE) on the machine;
10-
5. Once the installation is complete, leave the option ticked to open the homepage for configuration.
8+
2. Run the installer ...
9+
3. Choose any HTTP port for the listener if asked (it may automatically choose the default 8080 if available);
10+
4. Choose the ASCII character set. You will have to ensure nhibernate.oracle.use_n_prefixed_types_for_unicode
11+
parameter is set to true; Choosing instead the Unicode character set will cause some NHibernate tests to fail.
12+
5. Enter 'password' as the password for the SYS and SYSTEM accounts;
13+
6. The setup should install Oracle on the machine.
1114

1215
Creating the NH Schema:
1316

14-
a. Login to the homepage using login/password SYSTEM/password;
15-
b. Select Administration->Database Users->Create User;
16-
c. Enter Username=nhibernate, Password=nhibernate, and select the DBA role;
17-
d. Click 'Create' to create the user/schema.
17+
a. Run SQL Plus:
18+
SQL*Plus: Release XXX Production on YYY
19+
Copyright (c) 1982, 2014, Oracle. All rights reserved.
20+
Enter user-name:
21+
b. Enter:
22+
/ as SYSDBA
23+
Expected result:
24+
Connected to:
25+
Oracle Database XXX
26+
SQL>
27+
c. Enter
28+
create user nhibernate identified by nhibernate;
29+
d. If it fails with ORA-65096, enter following command then go back to c.
30+
alter session set "_ORACLE_SCRIPT"=true;
31+
e. Once the user is created, enter:
32+
grant dba to nhibernate;
33+
34+
Resolve conflict between Oracle client and with the managed driver NuGet package (12.1 and below):
35+
36+
1. Within an elevated command line, navigate to {Oracle home}\product\{version}\{dbhome}\ODP.NET\managed\x64
37+
2. Run
38+
OraProvCfg /action:ungac /providerPath:Oracle.ManagedDataAccess
39+
This is needed because NHibernate test uses the managed driver NuGet package, but Oracle client installation
40+
(excepted 12.2 and higher) put in the GAC a conflicting version of the assembly. This conflicting
41+
version needs to be removed from the GAC. Read more on https://stackoverflow.com/a/35176586/1178314.
42+
Not doing this may notably cause failures in distributed transaction tests.
43+
44+
Adjust the connection string for the tests:
45+
The tests involve creating and dropping many tables, sometimes with the same names but different data
46+
types. This does not play well with Oracle meta data pooling, which needs to be disabled.
47+
Add into your ODP.NET connection string:
48+
Metadata Pooling=false;Self Tuning=false;
1849

50+
Please note that some tests are dependent on the machine locales, and may fail if they are not English.

src/.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
*.scc
2323
*.tokens
2424
[Bb]in
25-
[Db]ebug*/
25+
[Db]ebug/
2626
obj/
27-
[Rr]elease*/
27+
[Rr]elease/
2828
*resharper*
2929
_ReSharper*/
3030
[Tt]est[Rr]esult*

src/AsyncGenerator.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
projects:
22
- filePath: NHibernate/NHibernate.csproj
3+
targetFramework: net461
34
concurrentRun: true
45
applyChanges: true
56
analyzation:
@@ -156,13 +157,15 @@
156157
- type: AsyncGenerator.Core.Plugins.EmptyRegionRemover
157158
assemblyName: AsyncGenerator.Core
158159
- filePath: NHibernate.DomainModel/NHibernate.DomainModel.csproj
160+
targetFramework: net461
159161
concurrentRun: true
160162
applyChanges: true
161163
analyzation:
162164
scanMethodBody: true
163165
scanForMissingAsyncMembers:
164166
- all: true
165167
- filePath: NHibernate.Test/NHibernate.Test.csproj
168+
targetFramework: net461
166169
concurrentRun: true
167170
applyChanges: true
168171
analyzation:

src/NHibernate.Config.Templates/Oracle-Managed.cfg.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ for your own use before compile tests in VisualStudio.
99
<session-factory name="NHibernate.Test">
1010
<property name="connection.driver_class">NHibernate.Driver.OracleManagedDataClientDriver</property>
1111
<property name="connection.connection_string">
12-
User ID=nhibernate;Password=nhibernate;Data Source=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE)))
12+
User ID=nhibernate;Password=nhibernate;Data Source=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORCL)))
1313
</property>
1414
<property name="show_sql">false</property>
1515
<property name="dialect">NHibernate.Dialect.Oracle10gDialect</property>
1616
<property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>
1717
</session-factory>
18-
</hibernate-configuration>
18+
</hibernate-configuration>

src/NHibernate.DomainModel/Async/CustomPersister.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
using NHibernate.Tuple.Entity;
2222
using NHibernate.Type;
2323
using NHibernate.Util;
24+
using Array = System.Array;
2425

2526
namespace NHibernate.DomainModel
2627
{

src/NHibernate.DomainModel/Baz.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ public void SetDefaults()
396396
StringArray = StringSet.ToArray();
397397
StringList = new List<string>(StringArray);
398398
IntArray = new int[] {1, 3, 3, 7};
399-
FooArray = new Foo[0];
399+
FooArray = Array.Empty<Foo>();
400400

401401
Customs = new List<string[]>();
402402
Customs.Add(new String[] {"foo", "bar"});

src/NHibernate.DomainModel/CustomPersister.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
using NHibernate.Tuple.Entity;
1212
using NHibernate.Type;
1313
using NHibernate.Util;
14+
using Array = System.Array;
1415

1516
namespace NHibernate.DomainModel
1617
{
@@ -130,12 +131,12 @@ public bool[] PropertyInsertability
130131

131132
public ValueInclusion[] PropertyInsertGenerationInclusions
132133
{
133-
get { return new ValueInclusion[0]; }
134+
get { return Array.Empty<ValueInclusion>(); }
134135
}
135136

136137
public ValueInclusion[] PropertyUpdateGenerationInclusions
137138
{
138-
get { return new ValueInclusion[0]; }
139+
get { return Array.Empty<ValueInclusion>(); }
139140
}
140141

141142
public bool[] PropertyCheckability

src/NHibernate.DomainModel/Foo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ public FooComponent Component
322322
public FooComponent NullComponent
323323
{
324324
get { return null; }
325-
set { if (value != null) throw new Exception("Null component"); }
325+
set { if (value != null) throw new ArgumentException("Null component"); }
326326
}
327327

328328
#endregion
@@ -432,4 +432,4 @@ public bool EqualsFoo(Foo other)
432432

433433
private static int count = 0;
434434
}
435-
}
435+
}

src/NHibernate.DomainModel/FooComponent.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ private String NullString
110110
set
111111
{
112112
if (value != null)
113-
throw new Exception("null component property");
113+
throw new ArgumentException("null component property");
114114
}
115115
}
116116

@@ -179,4 +179,4 @@ public override string ToString()
179179

180180
#endregion
181181
}
182-
}
182+
}

src/NHibernate.DomainModel/NHibernate.DomainModel.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
<IsTestProject>true</IsTestProject>
77
<NoWarn>$(NoWarn);3001;3002;3003;3005</NoWarn>
88
</PropertyGroup>
9-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
10-
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
11-
<TreatSpecificWarningsAsErrors />
12-
</PropertyGroup>
139
<ItemGroup>
1410
<None Remove="**\*.hbm.xml" />
1511
</ItemGroup>

src/NHibernate.Example.Web/Infrastructure/NHibernateToMicrosoftLogger.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public NHibernateToMicrosoftLogger(ILogger msLogger)
1818
{
1919
{ NHibernateLogLevel.Trace, LogLevel.Trace },
2020
{ NHibernateLogLevel.Debug, LogLevel.Debug },
21+
{ NHibernateLogLevel.Info, LogLevel.Information },
2122
{ NHibernateLogLevel.Warn, LogLevel.Warning },
2223
{ NHibernateLogLevel.Error, LogLevel.Error },
2324
{ NHibernateLogLevel.Fatal, LogLevel.Critical },

src/NHibernate.Test/Async/Component/Basic/ComponentTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ protected override string MappingsAssembly
3232

3333
protected override System.Collections.IList Mappings
3434
{
35-
get { return new string[] { }; }
35+
get { return Array.Empty<string>(); }
3636
}
3737

3838
protected override void Configure(Configuration configuration)

src/NHibernate.Test/Async/Criteria/DetachedCriteriaSerializable.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,4 +185,4 @@ public async Task ExecutableCriteriaAsync()
185185
await (SerializeAndListAsync(dc));
186186
}
187187
}
188-
}
188+
}

0 commit comments

Comments
 (0)