Вопрос

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