From: <fab...@us...> - 2009-05-13 15:38:04
|
Revision: 4289 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4289&view=rev Author: fabiomaulo Date: 2009-05-13 15:37:55 +0000 (Wed, 13 May 2009) Log Message: ----------- REVERT of SqlClientBatchingBatcher changes after r4279 Modified Paths: -------------- trunk/nhibernate/src/NHibernate/AdoNet/SqlClientBatchingBatcher.cs Modified: trunk/nhibernate/src/NHibernate/AdoNet/SqlClientBatchingBatcher.cs =================================================================== --- trunk/nhibernate/src/NHibernate/AdoNet/SqlClientBatchingBatcher.cs 2009-05-13 09:17:42 UTC (rev 4288) +++ trunk/nhibernate/src/NHibernate/AdoNet/SqlClientBatchingBatcher.cs 2009-05-13 15:37:55 UTC (rev 4289) @@ -19,7 +19,10 @@ { batchSize = Factory.Settings.AdoBatchSize; currentBatch = new SqlClientSqlCommandSet(); - currentBatchCommandsLog = new StringBuilder(); + if (log.IsDebugEnabled) + { + currentBatchCommandsLog = new StringBuilder(); + } } public override int BatchSize @@ -32,21 +35,24 @@ { totalExpectedRowsAffected += expectation.ExpectedRowCount; IDbCommand batchUpdate = CurrentCommand; - - if (log.IsDebugEnabled || Factory.Settings.SqlStatementLogger.IsDebugEnabled) + if (log.IsDebugEnabled) { string lineWithParameters = Factory.Settings.SqlStatementLogger.GetCommandLineWithParameters(batchUpdate); - currentBatchCommandsLog.Append("Batch command: ").AppendLine(lineWithParameters); if (Factory.Settings.SqlStatementLogger.IsDebugEnabled) { Factory.Settings.SqlStatementLogger.LogCommand("Adding to batch:", batchUpdate, FormatStyle.Basic); } - else if (log.IsDebugEnabled) + else { log.Debug("Adding to batch:" + lineWithParameters); } - currentBatch.Append((System.Data.SqlClient.SqlCommand)batchUpdate); + currentBatchCommandsLog.Append("Batch command: ").AppendLine(lineWithParameters); } + else + { + Factory.Settings.SqlStatementLogger.LogCommand(batchUpdate, FormatStyle.Basic); + } + currentBatch.Append((System.Data.SqlClient.SqlCommand)batchUpdate); if (currentBatch.CountOfCommands >= batchSize) { DoExecuteBatch(batchUpdate); @@ -58,11 +64,11 @@ log.Debug("Executing batch"); CheckReaders(); Prepare(currentBatch.BatchCommand); - if (log.IsDebugEnabled || Factory.Settings.SqlStatementLogger.IsDebugEnabled) + if (log.IsDebugEnabled) { if (Factory.Settings.SqlStatementLogger.IsDebugEnabled) Factory.Settings.SqlStatementLogger.LogBatchCommand(currentBatchCommandsLog.ToString()); - else if (log.IsDebugEnabled) + else log.Debug(currentBatchCommandsLog.ToString()); currentBatchCommandsLog = new StringBuilder(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |