File tree Expand file tree Collapse file tree 4 files changed +20
-9
lines changed Expand file tree Collapse file tree 4 files changed +20
-9
lines changed Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . Collections ;
3
3
using System . Linq ;
4
- using log4net ;
5
4
using NHibernate . AdoNet ;
6
5
using NHibernate . Cfg ;
7
6
using NHibernate . Dialect ;
@@ -24,6 +23,13 @@ protected override void Configure(Configuration configuration)
24
23
configuration . SetProperty ( Environment . BatchSize , "1000" ) ;
25
24
}
26
25
26
+ protected override bool AppliesTo ( Dialect . Dialect dialect )
27
+ {
28
+ return ! ( dialect is FirebirdDialect ) &&
29
+ ! ( dialect is Oracle8iDialect ) &&
30
+ ! ( dialect is MsSqlCeDialect ) ;
31
+ }
32
+
27
33
[ Test ]
28
34
public void MassiveInsertUpdateDeleteTest ( )
29
35
{
Original file line number Diff line number Diff line change 11
11
using System ;
12
12
using System . Collections ;
13
13
using System . Linq ;
14
- using log4net ;
15
14
using NHibernate . AdoNet ;
16
15
using NHibernate . Cfg ;
17
16
using NHibernate . Dialect ;
@@ -37,6 +36,13 @@ protected override void Configure(Configuration configuration)
37
36
configuration . SetProperty ( Environment . BatchSize , "1000" ) ;
38
37
}
39
38
39
+ protected override bool AppliesTo ( Dialect . Dialect dialect )
40
+ {
41
+ return ! ( dialect is FirebirdDialect ) &&
42
+ ! ( dialect is Oracle8iDialect ) &&
43
+ ! ( dialect is MsSqlCeDialect ) ;
44
+ }
45
+
40
46
[ Test ]
41
47
public async Task MassiveInsertUpdateDeleteTestAsync ( )
42
48
{
Original file line number Diff line number Diff line change @@ -10,7 +10,12 @@ namespace NHibernate.AdoNet
10
10
{
11
11
/// <summary>
12
12
/// 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
14
19
/// </summary>
15
20
public partial class GenericBatchingBatcher : AbstractBatcher
16
21
{
@@ -184,9 +189,6 @@ public int ExecuteNonQuery()
184
189
{
185
190
return 0 ;
186
191
}
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.
190
192
_batcher . Prepare ( _batchCommand ) ;
191
193
return _batchCommand . ExecuteNonQuery ( ) ;
192
194
}
Original file line number Diff line number Diff line change @@ -103,9 +103,6 @@ public async Task<int> ExecuteNonQueryAsync(CancellationToken cancellationToken)
103
103
{
104
104
return 0 ;
105
105
}
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.
109
106
await ( _batcher . PrepareAsync ( _batchCommand , cancellationToken ) ) . ConfigureAwait ( false ) ;
110
107
return await ( _batchCommand . ExecuteNonQueryAsync ( cancellationToken ) ) . ConfigureAwait ( false ) ;
111
108
}
You can’t perform that action at this time.
0 commit comments