tags:

views:

142

answers:

0

I have an entity that when it has a property updated, it ends up causing two updates with exactly the same SQL. There are many possible causes of this, but I've verified that there's a problem only if adonet.batch_size is anything greater than 0. If adonet.batch_size = 0, then there's just one update.

Has anybody else ever run into this (note that I'm using Oracle with the latest ODP.NET and haven't verified the same on SQL Server etc.)?

I have however, verified that the same problem occurs for other entities that work fine when adonet.batch_size is set to 0.

Here's my config:

<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
    <session-factory>
        <property name="dialect">NHibernate.Dialect.Oracle9Dialect</property>
        <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
        <property name="connection.driver_class">NHibernate.Driver.OracleDataClientDriver</property>
        <property name="connection.connection_string_name">BlahConnectionString</property>
        <property name="cache.provider_class">NHibernate.Caches.SysCache.SysCacheProvider, NHibernate.Caches.SysCache</property>
        <property name="cache.use_second_level_cache">false</property>
        <property name="cache.use_query_cache">false</property>
        <property name="adonet.batch_size">10</property>
        <property name="generate_statistics">false</property>
        <property name="show_sql">false</property>
        <mapping assembly="Blah.Core"/>
    </session-factory>
</hibernate-configuration>

For kicks, here's a sample hbm file (stripped down while debugging) for an entity that demonstrates this issue:

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Blah.Core" namespace="Blah.Core" >
  <class name="Blah.Core.Domain.User.Profile,Blah.Core" table="`PROFILE`">
<id name="ID" type="int" column="`Profile`">
  <generator class="sequence">
    <param name="sequence">PROFILE_SEQ</param>
  </generator>
</id>
 <property name="Email" type="AnsiString" column="`Email`" not-null="false" />
</class>
</hibernate-mapping>