views:

213

answers:

1

How do I set the batch size for Nhibernate? I'd like to do this in the web.config. The examples I see, don't make a lot of sense to me.

In this example they are using code to set the batch size. I don't wnat to do that. I want it configurable in the web.config.

I understand how to add the config section, I just have read articles that differ on how to set this batch size. Most of them show batch size being set in code, and the ones that show it in the config use different names, or an appsettings key. Confusing.

When I add the config section into my web.config do I need to do anything special when creating the session or will nhibernate pick up the settings automatically?

A: 

in case anyone is wondering, I ended up just resorting to setting it up in my fluentnhibernate session factory.

Fluently.Configure().Database(
        FluentNHibernate.Cfg.Db.MsSqlConfiguration.MsSql2005
               .ConnectionString(c => c.FromConnectionStringWithKey("MyDatabase"))
               .AdoNetBatchSize(20)
)
Josh