diff --git a/build-common/nhibernate-properties.xml b/build-common/nhibernate-properties.xml
index 731b7291f0e..4b62e992a55 100644
--- a/build-common/nhibernate-properties.xml
+++ b/build-common/nhibernate-properties.xml
@@ -2,6 +2,6 @@
-
+
diff --git a/build-common/teamcity-hibernate.cfg.xml b/build-common/teamcity-hibernate.cfg.xml
index a744013560e..0e038aa76ea 100644
--- a/build-common/teamcity-hibernate.cfg.xml
+++ b/build-common/teamcity-hibernate.cfg.xml
@@ -15,7 +15,7 @@
true
- NHibernate.Driver.SqlClientDriver
+ NHibernate.Driver.Sql2008ClientDriver
NHibernate.Dialect.MsSql2008Dialect
Server=.\SQLExpress;initial catalog=nhibernate;Integrated Security=SSPI
false
diff --git a/doc/reference/modules/configuration.xml b/doc/reference/modules/configuration.xml
index 6e65cd3cce8..72947b9af9e 100644
--- a/doc/reference/modules/configuration.xml
+++ b/doc/reference/modules/configuration.xml
@@ -1002,12 +1002,6 @@ ISession session = sessions.OpenSession(conn);
-
- NHibernate.Connection.DriverConnectionProvider
-
-
- NHibernate.Driver.SqlClientDriver
-
Server=localhost;initial catalog=nhibernate;User Id=;Password=
diff --git a/doc/reference/modules/example_weblog.xml b/doc/reference/modules/example_weblog.xml
index 81c43714126..90159f6b2ee 100644
--- a/doc/reference/modules/example_weblog.xml
+++ b/doc/reference/modules/example_weblog.xml
@@ -333,9 +333,6 @@ namespace Eg
NHibernate.Dialect.MsSql2012Dialect
-
- NHibernate.Connection.DriverConnectionProvider
-
Server=localhost\SQLEXPRESS;initial catalog=Eg;Integrated Security=True
diff --git a/doc/reference/modules/quickstart.xml b/doc/reference/modules/quickstart.xml
index 82e07fc1f6c..ee75ba405ea 100644
--- a/doc/reference/modules/quickstart.xml
+++ b/doc/reference/modules/quickstart.xml
@@ -52,9 +52,6 @@
NHibernate.Dialect.MsSql2012Dialect
-
- NHibernate.Connection.DriverConnectionProvider
-
Server=localhost\SQLEXPRESS;initial catalog=quickstart;Integrated Security=True
diff --git a/src/NHibernate.Config.Templates/MSSQL.cfg.xml b/src/NHibernate.Config.Templates/MSSQL.cfg.xml
index 70397662e4e..8e5706a5c56 100644
--- a/src/NHibernate.Config.Templates/MSSQL.cfg.xml
+++ b/src/NHibernate.Config.Templates/MSSQL.cfg.xml
@@ -7,10 +7,10 @@ for your own use before compile tests in VisualStudio.
- NHibernate.Driver.SqlClientDriver
+ NHibernate.Driver.Sql2008ClientDriver
Server=(local);initial catalog=nhibernate;Integrated Security=SSPI
NHibernate.Dialect.MsSql2008Dialect
-
\ No newline at end of file
+
diff --git a/src/NHibernate.Example.Web/Infrastructure/AppSessionFactory.cs b/src/NHibernate.Example.Web/Infrastructure/AppSessionFactory.cs
index c4d0a9de046..663b9dfcbe8 100644
--- a/src/NHibernate.Example.Web/Infrastructure/AppSessionFactory.cs
+++ b/src/NHibernate.Example.Web/Infrastructure/AppSessionFactory.cs
@@ -24,7 +24,7 @@ public AppSessionFactory(Microsoft.Extensions.Logging.ILoggerFactory loggerFacto
{
db.ConnectionString = @"Server=(local)\SQLEXPRESS;initial catalog=nhibernate;Integrated Security=true";
db.Dialect();
- db.Driver();
+ db.Driver();
})
.AddMapping(domainMapping);
Configuration.SessionFactory().GenerateStatistics();
@@ -37,4 +37,4 @@ public ISession OpenSession()
return SessionFactory.OpenSession();
}
}
-}
\ No newline at end of file
+}
diff --git a/src/NHibernate.Test/App.config b/src/NHibernate.Test/App.config
index 83a2785b7d4..9d77dbe89e1 100644
--- a/src/NHibernate.Test/App.config
+++ b/src/NHibernate.Test/App.config
@@ -30,7 +30,7 @@
NHibernate.Dialect.MsSql2008Dialect
- NHibernate.Driver.SqlClientDriver
+ NHibernate.Driver.Sql2008ClientDriver
TestConnectionString
NHibernate.Test.DebugConnectionProvider, NHibernate.Test
ReadCommitted
diff --git a/src/NHibernate.Test/Async/FilterTest/DynamicFilterTest.cs b/src/NHibernate.Test/Async/FilterTest/DynamicFilterTest.cs
index 481aa9898d5..8814d227e94 100644
--- a/src/NHibernate.Test/Async/FilterTest/DynamicFilterTest.cs
+++ b/src/NHibernate.Test/Async/FilterTest/DynamicFilterTest.cs
@@ -773,4 +773,4 @@ public void Dispose()
}
}
}
-}
\ No newline at end of file
+}
diff --git a/src/NHibernate.Test/Async/Hql/Ast/LimitClauseFixture.cs b/src/NHibernate.Test/Async/Hql/Ast/LimitClauseFixture.cs
index d2db0191934..90d885db753 100644
--- a/src/NHibernate.Test/Async/Hql/Ast/LimitClauseFixture.cs
+++ b/src/NHibernate.Test/Async/Hql/Ast/LimitClauseFixture.cs
@@ -10,7 +10,9 @@
using System.Linq;
using NHibernate.Cfg;
+using NHibernate.Driver;
using NHibernate.Hql.Ast.ANTLR;
+using NHibernate.Util;
using NUnit.Framework;
namespace NHibernate.Test.Hql.Ast
@@ -22,7 +24,8 @@ public class LimitClauseFixtureAsync : BaseFixture
protected override bool AppliesTo(Dialect.Dialect dialect)
{
return dialect.SupportsVariableLimit
- && !(Dialect is Dialect.MsSql2000Dialect && cfg.Properties[Environment.ConnectionDriver] == typeof(Driver.OdbcDriver).FullName); // don't know why, but these tests don't work on SQL Server using ODBC
+ && !(Dialect is Dialect.MsSql2000Dialect && // don't know why, but these tests don't work on SQL Server using ODBC
+ typeof(OdbcDriver).IsAssignableFrom(ReflectHelper.ClassForName(cfg.GetProperty(Environment.ConnectionDriver))));
}
protected override void OnSetUp()
@@ -186,4 +189,4 @@ public async Task TakeWithParameterAsync()
s.Close();
}
}
-}
\ No newline at end of file
+}
diff --git a/src/NHibernate.Test/Async/NHSpecificTest/NH1144/Fixture.cs b/src/NHibernate.Test/Async/NHSpecificTest/NH1144/Fixture.cs
index 285a68ed21a..1e7ecd3c116 100644
--- a/src/NHibernate.Test/Async/NHSpecificTest/NH1144/Fixture.cs
+++ b/src/NHibernate.Test/Async/NHSpecificTest/NH1144/Fixture.cs
@@ -12,6 +12,7 @@
using NHibernate.AdoNet;
using NHibernate.Cfg;
using NHibernate.Driver;
+using NHibernate.Util;
using NUnit.Framework;
namespace NHibernate.Test.NHSpecificTest.NH1144
@@ -36,7 +37,7 @@ protected override void Configure(Configuration configuration)
[Test]
public async Task CanSaveInSingleBatchAsync()
{
- if (configuration.Properties[Environment.ConnectionDriver].Contains(typeof (OracleDataClientDriver).Name) == false)
+ if (!typeof(OracleDataClientDriver).IsAssignableFrom(ReflectHelper.ClassForName(cfg.GetProperty(Environment.ConnectionDriver))))
{
Assert.Ignore("Only applicable for Oracle Data Client driver");
}
@@ -85,4 +86,4 @@ public async Task CanSaveInSingleBatchAsync()
Assert.IsTrue(executedBatch);
}
}
-}
\ No newline at end of file
+}
diff --git a/src/NHibernate.Test/Async/NHSpecificTest/NH2207/SampleTest.cs b/src/NHibernate.Test/Async/NHSpecificTest/NH2207/SampleTest.cs
new file mode 100644
index 00000000000..dd26d362887
--- /dev/null
+++ b/src/NHibernate.Test/Async/NHSpecificTest/NH2207/SampleTest.cs
@@ -0,0 +1,107 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System;
+using System.Data;
+using NHibernate.Dialect;
+using NHibernate.Driver;
+using NHibernate.Engine;
+using NUnit.Framework;
+
+namespace NHibernate.Test.NHSpecificTest.NH2207
+{
+ using System.Threading.Tasks;
+ using System.Threading;
+ [TestFixture]
+ public class SampleTestAsync : BugTestCase
+ {
+ protected override bool AppliesTo(Dialect.Dialect dialect)
+ {
+ return dialect is MsSql2008Dialect;
+ }
+
+ protected override bool AppliesTo(ISessionFactoryImplementor factory)
+ {
+ return factory.ConnectionProvider.Driver is Sql2008ClientDriver;
+ }
+
+ [Test]
+ public async Task WithoutUseNHSqlDataProviderWorkProperlyAsync()
+ {
+ var createTable = "CREATE TABLE TryDate([Id] [int] IDENTITY(1,1) NOT NULL,[MyDate] [date] NOT NULL)";
+ var dropTable = "DROP TABLE TryDate";
+ var insertTable = "INSERT INTO TryDate([MyDate]) VALUES(@p0)";
+ using(var sqlConnection = new System.Data.SqlClient.SqlConnection(cfg.Properties[Cfg.Environment.ConnectionString]))
+ {
+ await (sqlConnection.OpenAsync(CancellationToken.None));
+ using (var tx = sqlConnection.BeginTransaction())
+ {
+ var command = sqlConnection.CreateCommand();
+ command.Transaction = tx;
+ command.CommandText = createTable;
+ await (command.ExecuteNonQueryAsync(CancellationToken.None));
+ tx.Commit();
+ }
+
+ try
+ {
+ using (var tx = sqlConnection.BeginTransaction())
+ {
+ var command = sqlConnection.CreateCommand();
+ command.Transaction = tx;
+ command.CommandText = insertTable;
+ var dateParam = command.CreateParameter();
+ dateParam.ParameterName = "@p0";
+ dateParam.DbType = DbType.Date;
+ dateParam.SqlDbType = SqlDbType.Date;
+ dateParam.Value = DateTime.MinValue.Date;
+ command.Parameters.Add(dateParam);
+ await (command.ExecuteNonQueryAsync(CancellationToken.None));
+ tx.Commit();
+ }
+ }
+ finally
+ {
+ using (var tx = sqlConnection.BeginTransaction())
+ {
+ var command = sqlConnection.CreateCommand();
+ command.Transaction = tx;
+ command.CommandText = dropTable;
+ await (command.ExecuteNonQueryAsync(CancellationToken.None));
+ tx.Commit();
+ }
+ }
+ }
+ }
+
+ [Test]
+ public async Task Dates_Before_1753_Should_Not_Insert_NullAsync()
+ {
+ object savedId;
+ var expectedStoredValue = DateTime.MinValue.Date.AddDays(1).Date;
+ using (ISession session = OpenSession())
+ using (var tx = session.BeginTransaction())
+ {
+ var concrete = new DomainClass{Date = expectedStoredValue.AddMinutes(90)};
+ savedId = await (session.SaveAsync(concrete));
+ await (tx.CommitAsync());
+ }
+
+ using (ISession session = OpenSession())
+ using (var tx = session.BeginTransaction())
+ {
+ var savedObj = await (session.GetAsync(savedId));
+ Assert.That(savedObj.Date, Is.EqualTo(expectedStoredValue));
+ await (session.DeleteAsync(savedObj));
+ await (tx.CommitAsync());
+ }
+ }
+ }
+}
diff --git a/src/NHibernate.Test/Async/NHSpecificTest/NH3202/Fixture.cs b/src/NHibernate.Test/Async/NHSpecificTest/NH3202/Fixture.cs
index 87762cf3627..61a8bf45526 100644
--- a/src/NHibernate.Test/Async/NHSpecificTest/NH3202/Fixture.cs
+++ b/src/NHibernate.Test/Async/NHSpecificTest/NH3202/Fixture.cs
@@ -13,6 +13,7 @@
using NHibernate.Cfg;
using NHibernate.Dialect;
using NHibernate.Driver;
+using NHibernate.Util;
using NUnit.Framework;
namespace NHibernate.Test.NHSpecificTest.NH3202
@@ -26,7 +27,7 @@ protected override void Configure(Configuration configuration)
if (!(Dialect is MsSql2008Dialect))
Assert.Ignore("Test is for MS SQL Server dialect only (custom dialect).");
- if (!Environment.ConnectionDriver.Contains("SqlClientDriver"))
+ if (!typeof(SqlClientDriver).IsAssignableFrom(ReflectHelper.ClassForName(cfg.GetProperty(Environment.ConnectionDriver))))
Assert.Ignore("Test is for MS SQL Server driver only (custom driver is used).");
cfg.SetProperty(Environment.Dialect, typeof(OffsetStartsAtOneTestDialect).AssemblyQualifiedName);
diff --git a/src/NHibernate.Test/Async/TypesTest/DateTypeTest.cs b/src/NHibernate.Test/Async/TypesTest/DateTypeTest.cs
new file mode 100644
index 00000000000..72ceadfc151
--- /dev/null
+++ b/src/NHibernate.Test/Async/TypesTest/DateTypeTest.cs
@@ -0,0 +1,97 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using System.Collections.Generic;
+using NHibernate.Dialect;
+using NHibernate.Type;
+using NUnit.Framework;
+using System;
+
+namespace NHibernate.Test.TypesTest
+{
+ using System.Threading.Tasks;
+ using System.Threading;
+
+ [TestFixture]
+ public class DateTypeFixtureAsync : TypeFixtureBase
+ {
+ protected override string TypeName
+ {
+ get { return "Date"; }
+ }
+
+ [Test]
+ public Task ReadWriteNormalAsync()
+ {
+ try
+ {
+ var expected = DateTime.Today;
+
+ return ReadWriteAsync(expected);
+ }
+ catch (Exception ex)
+ {
+ return Task.FromException