private void ClearCurrentBatch() { _currentBatch.Dispose(); _totalExpectedRowsAffected = 0; _currentBatch = CreateConfiguredBatch(); if (Factory.Settings.SqlStatementLogger.IsDebugEnabled) { _currentBatchCommandsLog = new StringBuilder().AppendLine("Batch commands:"); } }
protected override void DoExecuteBatch(IDbCommand ps) { log.DebugFormat("Executing batch"); CheckReaders(); Prepare(currentBatch.BatchCommand); if (Factory.Settings.SqlStatementLogger.IsDebugEnabled) { Factory.Settings.SqlStatementLogger.LogBatchCommand(currentBatchCommandsLog.ToString()); currentBatchCommandsLog = new StringBuilder().AppendLine("Batch commands:"); } int rowsAffected = currentBatch.ExecuteNonQuery(); Expectations.VerifyOutcomeBatched(totalExpectedRowsAffected, rowsAffected); currentBatch.Dispose(); totalExpectedRowsAffected = 0; currentBatch = new SqlClientSqlCommandSet(); }