I have adonet.batch_size set to 10, but when I do a save on an object graph, it will save the object and all its children in a separate database call.
I can see this with the NHProf tool.
INSERT INTO Preferences
INSERT INTO PreferencesToWidgets
INSERT INTO PreferencesToWidgets
INSERT INTO PreferencesToWidgets
INSERT INTO PreferencesToWidgets
INSERT INTO PreferencesToWidgets
INSERT INTO PreferencesToWidgets
INSERT INTO PreferencesToWidgets
INSERT INTO PreferencesToWidgets
INSERT INTO PreferencesToWidgets
INSERT INTO PreferencesToWidgets
INSERT INTO Users
Users are tied to each other according to preferences | Many-to-One Preferences in PreferencesToWidgets
Basically, I have a user to whom I add a preference, and this preference has a bunch of widgets added to it.
Then I call session.SaveOrUpdate (user) and all objects are inserted into separate calls, even if the batch size is 10.
I am tuning through FluentNHibernate.
Fluently.Configure ()
.Database(FluentNHibernate.Cfg.Db.MsSqlConfiguration.MsSql2005.ConnectionString(c => c.FromConnectionStringWithKey( connectionStringKey ) )
.ProxyFactoryFactory( "NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu" ) )
.Mappings( m => m.FluentMappings.AddFromAssembly( typeof( SessionFactoryFactory ).Assembly ) )
.ExposeConfiguration( cfg => cfg.SetProperty( "generate_statistics", "true" ) )
.ExposeConfiguration( cfg => cfg.SetProperty( "adonet.batch_size", "10" ) )
.BuildSessionFactory();