GenericBatchingBatcher Question

40 views
Skip to first unread message

Daniel Sargeant

unread,
May 8, 2019, 2:09:02 PM5/8/19
to nhibernate-development
I am curious what is the advantage is of using the MySqlClientBatchingBatcher over the GenericBatchingBatcher? 

When I run the tests on batching and switch one for the other, they appear to produce the same SQL, so why use the database specific batcher?


Thanks

Frédéric Delaporte

unread,
May 10, 2019, 7:33:52 PM5/10/19
to nhibernate-development
The generic one has been introduced in 2018, while the specific one dates back to 2012.

So it could just be that the specific one is available since way longer. I have not checked if there could be any advantages in using the specific one.
It uses specific classes from MySql.Data.MySqlClient to do its work, but it has to dynamically build some delegates for doing this without taking a hard dependency on it. So I am not sure if overall it is an advantage or a drawback.

Daniel Sargeant

unread,
May 12, 2019, 2:07:16 PM5/12/19
to nhibernate-development
Ok, that is interesting to know. I had a look in the mysql-connector-net code to see if I could spot any advantages but it is not the easiest code base to navigate without previous knowledge. 

I also took a look at entity framework (Pomelo.EntityFrameworkCore.MySql) to see what they do in regards to batching and it looks like the only difference is that they also make use of the multiple insert syntax where possible, rather than using separate statements - they can do that as all the sql is fully parsed at that point. I couldn't see anything like that in the mysql-connector-net code.

Thanks
Reply all
Reply to author
Forward
0 new messages