Greg Roberts
Greg Roberts

Reputation: 2562

Why doesn't NHibernate support batching on MySql

I've found a couple places where people say it's not supported, but I can't find what the root cause is.

I recently found this patch for nHibernate that may resolve the issue, has anyone verified this as a workaround?

Is there another unsupported workaround?

Upvotes: 7

Views: 618

Answers (2)

Diego Mijelshon
Diego Mijelshon

Reputation: 52725

  • Has it just not been implemented?

Is the right answer.

The patch using a reference to MySql.Data will not get into the trunk in its current form because of the reasons mentioned by Rippo.

However, you don't need to compile NH with the patch. You can just inject the new Batcher.

It's as easy as:

config.DataBaseIntegration(
       db => db.Batcher<MySqlClientBatchingBatcherFactory>());

Upvotes: 6

Rippo
Rippo

Reputation: 22424

I suspect that the real reason is that this particular patch requires a dependency on mysql.data.dll within NHibernate itself.

See here e.g. +using MySql.Data.MySqlClient;

This would mean that people not using MySql would still need the DLL. I really think this is the reason. However there is nothing stopping you implementing the patch on the source of NHibernate and compiling the binaries yourself. I use MySql myself and have not come across another work around...

Upvotes: 0

Related Questions