From: <aye...@us...> - 2009-05-15 07:46:41
|
Revision: 4314 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4314&view=rev Author: ayenderahien Date: 2009-05-15 07:46:31 +0000 (Fri, 15 May 2009) Log Message: ----------- Fixing NRE when use dynamically change logging configuration 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-15 07:44:35 UTC (rev 4313) +++ trunk/nhibernate/src/NHibernate/AdoNet/SqlClientBatchingBatcher.cs 2009-05-15 07:46:31 UTC (rev 4314) @@ -19,10 +19,11 @@ { batchSize = Factory.Settings.AdoBatchSize; currentBatch = new SqlClientSqlCommandSet(); - if (log.IsDebugEnabled) - { - currentBatchCommandsLog = new StringBuilder(); - } + //we always create this, because we need to deal with a scenario in which + //the user change the logging configuration at runtime. Trying to put this + //behind an if(log.IsDebugEnabled) will cause a null reference exception + //at that point. + currentBatchCommandsLog = new StringBuilder(); } public override int BatchSize This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |