title: OracleDataClientBatchingBatcherFactory Throws Null Reference Exception
body: <p>We're using NHibernate version 4.0.4.4000 and configuring it with FluentNHibernate version 2.0.3.0. </p>
  
  <p>I'm trying to setup batching on an Oracle connection with the Oracle Data Client Batching Batcher Factory (OracleDataClientBatchingBatcherFactory) and using the following code to create NHConfiguration:</p>
  
  <pre><code>var cfg = new NHibernate.Cfg.Configuration().DataBaseIntegration(prop =&gt; {
          prop.BatchSize = 1000;
          prop.Batcher&lt;OracleDataClientBatchingBatcherFactory&gt;();
      });
  </code></pre>
  
  <p>Getting the following exception on session flush:</p>
  
  <pre><code>System.NullReferenceException: Object reference not set to an instance of an object.
     at NHibernate.AdoNet.OracleDataClientBatchingBatcher.SetArrayBindCount(Int32 arraySize)
     at NHibernate.AdoNet.OracleDataClientBatchingBatcher.DoExecuteBatch(IDbCommand ps) ...
  </code></pre>
  
  <p>It looks like SetArrayBindCount method is using reflection to set ArrayBindCount property in OracleCommand. This method throws a null reference exception.</p>
  
  <p>Did anyone else experience the same problem? Am I missing something or it's a bug in OracleDataClientBatchingBatcher?</p>
  
  <p>I do not get this problem when I use the SQL Client Batching Batcher Factory (SqlClientBatchingBatcherFactory) </p>
  
  <pre><code>var cfg = new NHibernate.Cfg.Configuration().DataBaseIntegration(prop =&gt; {
          prop.BatchSize = 1000;
          prop.Batcher&lt;SqlClientBatchingBatcherFactory&gt;();
      });
  </code></pre>
  
  <p>Any help will be greatly appreciated as this is currently blocking us.</p>
  
  <p>Question Origin: <a href="https://groups.google.com/forum/#%21topic/nhusers/-rzStjZSxmI" rel="nofollow">https://groups.google.com/forum/#%21topic/nhusers/-rzStjZSxmI</a></p>