1
- using System . Collections . Specialized ;
2
1
using System . Data ;
3
2
using System . Text ;
4
- using NHibernate . AdoNet ;
5
3
6
- namespace NHibernate . Impl
4
+ namespace NHibernate . AdoNet
7
5
{
8
6
/// <summary>
9
7
/// Summary description for SqlClientBatchingBatcher.
@@ -13,7 +11,7 @@ internal class SqlClientBatchingBatcher : BatcherImpl
13
11
private int batchSize ;
14
12
private int totalExpectedRowsAffected ;
15
13
private SqlClientSqlCommandSet currentBatch ;
16
- private StringBuilder currentBatchCommandsLog = new StringBuilder ( ) ;
14
+ private StringBuilder currentBatchCommandsLog = new StringBuilder ( ) ;
17
15
18
16
public SqlClientBatchingBatcher ( ConnectionManager connectionManager )
19
17
: base ( connectionManager )
@@ -33,10 +31,10 @@ public override void AddToBatch(IExpectation expectation)
33
31
totalExpectedRowsAffected += expectation . ExpectedRowCount ;
34
32
log . Debug ( "Adding to batch:" ) ;
35
33
IDbCommand batchUpdate = CurrentCommand ;
36
- string commandLoggedText = GetCommandLogString ( batchUpdate ) ;
37
- currentBatchCommandsLog . Append ( "Batch command: " ) .
38
- AppendLine ( commandLoggedText ) ;
39
- currentBatch . Append ( ( System . Data . SqlClient . SqlCommand ) batchUpdate ) ;
34
+ string commandLoggedText = GetCommandLogString ( batchUpdate ) ;
35
+ currentBatchCommandsLog . Append ( "Batch command: " ) .
36
+ AppendLine ( commandLoggedText ) ;
37
+ currentBatch . Append ( ( System . Data . SqlClient . SqlCommand ) batchUpdate ) ;
40
38
if ( currentBatch . CountOfCommands >= batchSize )
41
39
{
42
40
DoExecuteBatch ( batchUpdate ) ;
@@ -49,8 +47,8 @@ protected override void DoExecuteBatch(IDbCommand ps)
49
47
CheckReaders ( ) ;
50
48
Prepare ( currentBatch . BatchCommand ) ;
51
49
52
- logSql . Debug ( currentBatchCommandsLog . ToString ( ) ) ;
53
- currentBatchCommandsLog = new StringBuilder ( ) ;
50
+ logSql . Debug ( currentBatchCommandsLog . ToString ( ) ) ;
51
+ currentBatchCommandsLog = new StringBuilder ( ) ;
54
52
int rowsAffected = currentBatch . ExecuteNonQuery ( ) ;
55
53
56
54
Expectations . VerifyOutcomeBatched ( totalExpectedRowsAffected , rowsAffected ) ;
@@ -60,4 +58,4 @@ protected override void DoExecuteBatch(IDbCommand ps)
60
58
currentBatch = new SqlClientSqlCommandSet ( ) ;
61
59
}
62
60
}
63
- }
61
+ }
0 commit comments