문제

When setting the ado.batch_size property on the nhibernate configuration it is ignored. If I debug the session it shows the batch size as 1 even though I set it to 25.

Does NHibernate 3.3.3 support batching for Sybase Anywhere?

도움이 되었습니까?

해결책

No batching is only supported for the SQL Server Client and Oracle Client. The Sybase driver uses the NonBatchingBatcher which means no batching.

Extended Driver to use batching
I've created a Batcher for NHibernate http://pastebin.com/gbPs6w4a

Sample configuration
The key line is db.Driver

Configuration.DataBaseIntegration(
            db =>
            {
                db.ConnectionString = "Some Connection String"
                db.KeywordsAutoImport = Hbm2DDLKeyWords.None;
                db.Driver<SybaseSQLAnywhereDotNet4WithBatcherDriver>();
                db.Dialect<SybaseSQLAnywhere12Dialect>();
                db.BatchSize = 25;
                db.LogSqlInConsole = showSqlInConsoleWindow;
                db.LogFormattedSql = showSqlInConsoleWindow;
            });
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top