mrt181
mrt181

Reputation: 5316

Why is NHibernate's adonet.batch_size setting ignored - session.SetBachSize() throws exception?

I am using NHibernate and switched from my local SQLExpress database to Oracle11g.

My code started to complain. The session objects method SetBatchSize() throws a System.NotSupported exception:

No batch size was defined for the session factory, batching is disabled. Set adonet.batch_size = 1 to enable batching.

It worked on the SQLExpress database. Ok, so I added this

<property name="adonet.batch_size">1</property>

to the config but it still throws the same exception. The sessions Batcher property is set to this

Value: {NHibernate.AdoNet.NonBatchingBatcher}

Type: NHibernate.Engine.IBatcher {NHibernate.AdoNet.NonBatchingBatcher}

It does not make any difference if i try to set the batch size in- or outside the transaction.

Upvotes: 2

Views: 2868

Answers (1)

Firo
Firo

Reputation: 30813

NHibernate has only batcher for some RDBMs. if it doesn't find one for the database in question it defaults to nonbatchingbatcher which is not able to batch at all. you could implement your own IBatcher.

Upvotes: 2

Related Questions