【发布时间】:2015-02-25 14:12:51
【问题描述】:
我尝试在我的 SessionFactory 中启用 Bach Size:
Fluently.Configure()
.Database(MySQLConfiguration.Standard.AdoNetBatchSize(1)
.ConnectionString("xxx"))
.Mappings(m => m.FluentMappings.AddFromAssembly(...))
.ExposeConfiguration(c => c.SetProperty("adonet.batch_size", "1"))
.BuildSessionFactory();
但是当我想设置批量大小的值时:
Session = _sessionFactory.OpenSession();
Session.SetBatchSize(25);
Session.FlushMode = FlushMode.Commit;
我仍然收到该错误:
没有为会话工厂定义批处理大小,批处理是 禁用。设置 adonet.batch_size = 1 以启用批处理。
【问题讨论】:
标签: c# fluent-nhibernate