I got a really strange exception in NHibernate (v2.1.2.4000) last
night. My app was running all night logging some data, and then it
suddenly crashed. Looking at the log I found this exception being the
last thing written to log:
NHibernate.HibernateException:
An exception occurred when executing batch queries --->
System.ArgumentOutOfRangeException:
The CommandType enumeration value, 0, is invalid.
Parameter name: CommandType
at System.Data.SqlClient.SqlCommand.set_CommandType(CommandType value)
at System.Data.SqlClient.SqlCommand.AddBatchCommand
(String commandText, SqlParameterCollection parameters, CommandType
cmdType)
at System.Data.SqlClient.SqlCommandSet.ExecuteNonQuery()
at NHibernate.AdoNet.SqlClientSqlCommandSet.ExecuteNonQuery()
--- End of inner exception stack trace ---
at NHibernate.AdoNet.SqlClientSqlCommandSet.ExecuteNonQuery()
at
NHibernate.AdoNet.SqlClientBatchingBatcher.DoExecuteBatch(IDbCommand
ps)
at NHibernate.AdoNet.AbstractBatcher.ExecuteBatchWithTiming(IDbCommand
ps)
at NHibernate.AdoNet.AbstractBatcher.ExecuteBatch()
at NHibernate.Impl.StatelessSessionImpl.ManagedFlush()
at NHibernate.Impl.StatelessSessionImpl.Flush()
at NHibernate.Transaction.AdoTransaction.Commit()
at My.NHibernate.StatelessRepoSession.WithinTransaction(Action action)
at My.NHibernate.StatelessRepoSession.SaveMultiple[T](IEnumerable`1
items)
The strangest thing is that this same method persisted around million
items before this, so I don't see why it would fail all of a sudden.
Has anyone seen this problem before?
My NHibernate version is 2.1.2.4000. I was using a stateless session
to save around 800 items in this last transaction. My config file
looks like this:
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"
>
<session-factory>
<property name="connection.provider">
NHibernate.Connection.DriverConnectionProvider</
property>
<property name="connection.driver_class">
NHibernate.Driver.SqlClientDriver</property
<property name="connection.connection_string">
this part removed :) </property>
<property name="dialect">
NHibernate.Dialect.MsSql2005Dialect</property>
<property name='proxyfactory.factory_class'>
NHibernate.ByteCode.Castle.ProxyFactoryFactory,
NHibernate.ByteCode.Castle</property>
<property name='adonet.batch_size'>1500</property>
<property name='command_timeout'>600</property>
</session-factory>
</hibernate-configuration>
Batch size is a pretty large number here IMHO, I changed it yesterday
from 250 to 1500 to test the performance difference, but I never used
a value that large before. Could this have anything to do with the
problem?
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.