diff --git a/NHibernate5.SqlAzure.Tests/NHibernate5.SqlAzure.Tests.csproj b/NHibernate5.SqlAzure.Tests/NHibernate5.SqlAzure.Tests.csproj
index 0403260..2420b58 100644
--- a/NHibernate5.SqlAzure.Tests/NHibernate5.SqlAzure.Tests.csproj
+++ b/NHibernate5.SqlAzure.Tests/NHibernate5.SqlAzure.Tests.csproj
@@ -68,8 +68,9 @@
..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll
-
- ..\packages\NHibernate.5.2.3\lib\net461\NHibernate.dll
+
+ ..\packages\NHibernate.5.3.9\lib\net461\NHibernate.dll
+ True
..\packages\NUnit.2.6.2\lib\nunit.framework.dll
diff --git a/NHibernate5.SqlAzure.Tests/packages.config b/NHibernate5.SqlAzure.Tests/packages.config
index e6448bf..509882f 100644
--- a/NHibernate5.SqlAzure.Tests/packages.config
+++ b/NHibernate5.SqlAzure.Tests/packages.config
@@ -10,7 +10,7 @@
-
+
diff --git a/NHibernate5.SqlAzure/NHibernate5.SqlAzure.csproj b/NHibernate5.SqlAzure/NHibernate5.SqlAzure.csproj
index 5333aeb..bfaa0e9 100644
--- a/NHibernate5.SqlAzure/NHibernate5.SqlAzure.csproj
+++ b/NHibernate5.SqlAzure/NHibernate5.SqlAzure.csproj
@@ -44,8 +44,9 @@
..\packages\EnterpriseLibrary.TransientFaultHandling.Data.6.0.1304.1\lib\NET45\Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.Data.dll
-
- ..\packages\NHibernate.5.2.3\lib\net461\NHibernate.dll
+
+ ..\packages\NHibernate.5.3.9\lib\net461\NHibernate.dll
+ True
..\packages\Remotion.Linq.2.2.0\lib\net45\Remotion.Linq.dll
diff --git a/NHibernate5.SqlAzure/ReliableSqlClientBatchingBatcher.cs b/NHibernate5.SqlAzure/ReliableSqlClientBatchingBatcher.cs
index 5c3b2bb..222b71c 100644
--- a/NHibernate5.SqlAzure/ReliableSqlClientBatchingBatcher.cs
+++ b/NHibernate5.SqlAzure/ReliableSqlClientBatchingBatcher.cs
@@ -5,6 +5,8 @@
using System.Data.Common;
using System.Reflection;
using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
using NHibernate.AdoNet;
using NHibernate.AdoNet.Util;
using NHibernate.Exceptions;
@@ -94,35 +96,125 @@ public override void AddToBatch(IExpectation expectation)
#endregion
}
- // Need this method call in this class rather than the base class to ensure Prepare is called... if only it was virtual :(
- protected void ExecuteBatch(IDbCommand ps)
+ public override Task AddToBatchAsync(IExpectation expectation, CancellationToken cancellationToken)
{
#region NHibernate code
- Log.Debug("Executing batch");
- CheckReaders();
- Prepare(_currentBatch.BatchCommand);
- if (Factory.Settings.SqlStatementLogger.IsDebugEnabled)
+ if (cancellationToken.IsCancellationRequested)
{
- Factory.Settings.SqlStatementLogger.LogBatchCommand(_currentBatchCommandsLog.ToString());
- _currentBatchCommandsLog = new StringBuilder().AppendLine("Batch commands:");
+ return Task.FromCanceled