2

NHibernate with MySQL Dialect does not support Batching out of the box. I have found custom MySQL Batcher for NHibernate on nuget. Also, following is the github link:

https://github.com/Andorbal/NHibernate.MySQLBatcher

But I do not know how to inject/set this into my hibernate.cfg.xml configuration.

How to configure custom MySQL NHibernate Batcher?

4

1 に答える 1

4

設定する必要のあるプロパティは「adonet.factory_class」です。次のいずれかを使用します。

<property name="adonet.factory_class">assembly-qualified-name</property>

また

configuration.SetProperty(
    Environment.BatchStrategy,
    typeof(MySqlClientBatchingBatcherFactory).AssemblyQualifiedName);

または、バッチャー自体のreadme(https://github.com/Andorbal/NHibernate.MySQLBatcher)に記載されているように:

config.DataBaseIntegration(db =>
    db.Batcher<MySqlClientBatchingBatcherFactory>());
于 2013-01-08T17:15:26.487 に答える