NHibernate 2.1.0.4000 does not look like a batch insert

I am using NHibernate 2.1.0.4000 in one of the projects. I set adonet.batch_size to 100 in the cfg file, but still I see that the insert statement is considered as one statement. The update seems to be working fine. What's happening?

Updated: Is it because I chose the identifier as the primary key generator?

<id name="Id" column="Id" unsaved-value="0" type="Int32"> <generator class ="identity"></generator> </id> 
+4
source share
1 answer

I do not know any problems with this version of NHibernate.

Do you use native as an identifier generator for your objects? Because it will make each insertion be alone by selecting the generated identifier back. This is because the database must generate each identifier. It also explains why batch processing works with updates.

If possible, you should switch to, for example, hilo strategies or even guid if you do not need (easy) readable identifiers.

Fabio has an interesting post here regarding this topic.

+11
source

All Articles