Skip to content

Commit 2375c6d

Browse files
committed
Removed unsupported clients for the generic batcher from tests
1 parent 1014e35 commit 2375c6d

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

src/NHibernate.Test/Ado/GenericBatchingBatcherFixture.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Collections;
33
using System.Linq;
4-
using log4net;
54
using NHibernate.AdoNet;
65
using NHibernate.Cfg;
76
using NHibernate.Dialect;
@@ -24,6 +23,13 @@ protected override void Configure(Configuration configuration)
2423
configuration.SetProperty(Environment.BatchSize, "1000");
2524
}
2625

26+
protected override bool AppliesTo(Dialect.Dialect dialect)
27+
{
28+
return !(dialect is FirebirdDialect) &&
29+
!(dialect is Oracle8iDialect) &&
30+
!(dialect is MsSqlCeDialect);
31+
}
32+
2733
[Test]
2834
public void MassiveInsertUpdateDeleteTest()
2935
{

src/NHibernate.Test/Async/Ado/GenericBatchingBatcherFixture.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
using System;
1212
using System.Collections;
1313
using System.Linq;
14-
using log4net;
1514
using NHibernate.AdoNet;
1615
using NHibernate.Cfg;
1716
using NHibernate.Dialect;
@@ -37,6 +36,13 @@ protected override void Configure(Configuration configuration)
3736
configuration.SetProperty(Environment.BatchSize, "1000");
3837
}
3938

39+
protected override bool AppliesTo(Dialect.Dialect dialect)
40+
{
41+
return !(dialect is FirebirdDialect) &&
42+
!(dialect is Oracle8iDialect) &&
43+
!(dialect is MsSqlCeDialect);
44+
}
45+
4046
[Test]
4147
public async Task MassiveInsertUpdateDeleteTestAsync()
4248
{

src/NHibernate/AdoNet/GenericBatchingBatcher.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ namespace NHibernate.AdoNet
1010
{
1111
/// <summary>
1212
/// A generic batcher that will batch UPDATE/INSERT/DELETE commands by concatenating them with a semicolon.
13-
/// Use this batcher only if there are no dedicated batchers in the given environment.
13+
/// Use this batcher only if there are no dedicated batchers in the given environment. Unfortunately some
14+
/// database clients do not support concatenating commands with a semicolon. Here are the known clients
15+
/// that do not work with this batcher:
16+
/// - FirebirdSql.Data.FirebirdClient
17+
/// - Oracle.ManagedDataAccess
18+
/// - System.Data.SqlServerCe
1419
/// </summary>
1520
public partial class GenericBatchingBatcher : AbstractBatcher
1621
{
@@ -184,9 +189,6 @@ public int ExecuteNonQuery()
184189
{
185190
return 0;
186191
}
187-
// Npgsql will correctly prepare a multi SQL statement even if the parameter names are different
188-
// for each statement. Npgsql internally parses the query and omits parameter names when comparing two queries
189-
// in order to prevent having multiple prepared statements for the same query.
190192
_batcher.Prepare(_batchCommand);
191193
return _batchCommand.ExecuteNonQuery();
192194
}

src/NHibernate/Async/AdoNet/GenericBatchingBatcher.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ public async Task<int> ExecuteNonQueryAsync(CancellationToken cancellationToken)
103103
{
104104
return 0;
105105
}
106-
// Npgsql will correctly prepare a multi SQL statement even if the parameter names are different
107-
// for each statement. Npgsql internally parses the query and omits parameter names when comparing two queries
108-
// in order to prevent having multiple prepared statements for the same query.
109106
await (_batcher.PrepareAsync(_batchCommand, cancellationToken)).ConfigureAwait(false);
110107
return await (_batchCommand.ExecuteNonQueryAsync(cancellationToken)).ConfigureAwait(false);
111108
}

0 commit comments

Comments
 (0)